Merge branch 'main' of github.com:asosnovsky/nixos-setup

This commit is contained in:
ari committed 2024-07-27 12:47:15 -04:00
commit 3429f9511f
5 files changed
+57 -18

No files matched your search

+4 -18
View File
@@ -65,7 +65,7 @@
system = system;
config = { allowUnfree = true; };
});
makeHLService = lib.makeNixOsModuleMaker {
hlCommonSettings = {
system = "x86_64-linux";
user = user;
localNixCaches = localNixCaches;
@@ -88,6 +88,7 @@
};
};
};
makeHLService = lib.makeNixOsModuleMaker hlCommonSettings;
in
{
lib = lib;
@@ -159,10 +160,7 @@
# NIXOS Homelab - BIGBOX1
# -------------
nixosConfigurations."hl-bigbox1" = unstableLib.makeNixOsModule {
system = "x86_64-linux";
user = user;
localNixCaches = localNixCaches;
nixosConfigurations."hl-bigbox1" = unstableLib.makeNixOsModule (hlCommonSettings // {
systemStateVersion = "24.05";
hostName = "hl-bigbox1";
home-manager = {
@@ -170,20 +168,8 @@
enableDevelopmentKit = false;
version = "24.11";
};
enableNetworkDrives = true;
os = {
enable = true;
firewall = { enable = false; };
enableFonts = true;
hardware = { enable = false; };
enablePrometheusExporters = true;
containers = {
runtime = "docker";
localDockerRegistries = localDockerRegistries;
};
};
configuration = (import ./hosts/hl-bigbox1.nix { user = user; });
};
});
# NIXOS Homelab - minipc1
# -------------
@@ -0,0 +1,28 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/2c1a9e86-5b82-4545-bea1-c1b6b688fdf8";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/6583-1C43";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+2
View File
@@ -6,5 +6,7 @@
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Special udev rule for google's coral tpu
homelab.udevrules.coraltpu.enable = true;
}
+22
View File
@@ -0,0 +1,22 @@
{ config, lib, ... }:
with lib;
let cfg = config.homelab.udevrules.coraltpu;
in {
options = {
homelab.udevrules.coraltpu = {
enable = mkEnableOption
"Enable Coral TPU Udev rules";
symlinkName = mkOption {
description = "The special symlink to give to the coral tpu";
type = types.str;
default = "coral1";
};
};
};
config = mkIf cfg.enable {
services.udev.extraRules = ''
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a6e", ATTRS{idProduct}=="089a", MODE="0664", TAG+="uaccess", SYMLINK+="${cfg.symlinkName}"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9302", MODE="0664", TAG+="uaccess", SYMLINK+="${cfg.symlinkName}"
'';
};
}
+1
View File
@@ -2,5 +2,6 @@
{
imports = [
./audiobookshelf.nix
./coral-tpu-udev.nix
];
}