# Hardware configuration for NAS # TODO: Update disk labels/UUIDs after installation { config, lib, pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.loader.systemd-boot = { enable = true; configurationLimit = 5; }; boot.loader.efi.canTouchEfiVariables = true; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; # Power management kernel parameters boot.kernelParams = [ "intel_pstate=passive" # Better with powersave governor "i915.enable_rc6=1" # GPU deep sleep states "i915.enable_dc=2" # Display C-states (deepest) "i915.enable_fbc=1" # Frame buffer compression ]; # RAID 1 array for data storage boot.swraid = { enable = true; mdadmConf = '' DEVICE /dev/disk/by-id/ata-ST18000NM000J-2TV103_ZR52TBSB-part1 DEVICE /dev/disk/by-id/ata-ST18000NM000J-2TV103_ZR52V9QX-part1 ''; }; # Tmpfs root filesystem (ephemeral - resets on reboot) fileSystems."/" = { device = "none"; fsType = "tmpfs"; options = [ "size=8G" "mode=755" ]; }; # Boot partition - EFI fileSystems."/boot" = { device = "/dev/disk/by-partlabel/BOOT"; fsType = "vfat"; }; fileSystems."/nix" = { device = "/dev/disk/by-partlabel/NIXOS"; fsType = "btrfs"; neededForBoot = true; options = [ "subvol=@" "compress=zstd:1" "noatime" "commit=120" ]; }; fileSystems."/nix/store" = { device = "/dev/disk/by-partlabel/NIXOS"; fsType = "btrfs"; neededForBoot = true; options = [ "subvol=@nix-store" "compress=zstd:1" "noatime" "commit=120" ]; }; fileSystems."/nix/persist" = { device = "/dev/disk/by-partlabel/NIXOS"; fsType = "btrfs"; neededForBoot = true; options = [ "subvol=@nix-persist" "compress=zstd:1" "noatime" "commit=120" ]; }; # LVM volumes on RAID array fileSystems."/var/lib/downloads" = { device = "/dev/vg-data/lv-downloads"; fsType = "xfs"; options = [ "noatime" ]; }; fileSystems."/var/lib/multimedia" = { device = "/dev/vg-data/lv-multimedia"; fsType = "xfs"; options = [ "noatime" ]; }; # DHCP networking networking.useDHCP = lib.mkDefault true; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }