Personal Nix setup
at main 1.9 kB view raw
1{ lib, inputs, modulesPath, ... }: 2 3{ 4 imports = with inputs; [ 5 nixos-hardware.nixosModules.common-cpu-amd 6 nixos-hardware.nixosModules.common-cpu-amd-pstate 7 nixos-hardware.nixosModules.common-gpu-amd 8 nixos-hardware.nixosModules.common-pc-ssd 9 nixos-hardware.nixosModules.common-pc 10 lanzaboote.nixosModules.lanzaboote 11 (modulesPath + "/installer/scan/not-detected.nix") 12 ]; 13 14 boot = { 15 bootspec.enable = true; 16 17 initrd = { 18 availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; 19 }; 20 kernelModules = [ "kvm-amd" ]; 21 extraModulePackages = [ ]; 22 supportedFilesystems = [ "btrfs" ]; 23 24 loader = { 25 systemd-boot.enable = lib.mkForce false; 26 efi.canTouchEfiVariables = true; 27 }; 28 29 lanzaboote = { 30 enable = true; 31 pkiBundle = "/var/lib/sbctl"; 32 configurationLimit = 3; 33 }; 34 }; 35 36 fileSystems."/" = { 37 device = "/dev/disk/by-label/NIXROOT"; 38 fsType = "btrfs"; 39 options = [ "subvol=@root" "noatime" ]; 40 }; 41 42 fileSystems."/nix" = { 43 device = "/dev/disk/by-label/NIXROOT"; 44 fsType = "btrfs"; 45 options = [ "subvol=@nix" "noatime" "compress=zstd" ]; 46 }; 47 48 fileSystems."/home" = { 49 device = "/dev/disk/by-label/NIXROOT"; 50 fsType = "btrfs"; 51 options = [ "subvol=@home" "noatime" ]; 52 }; 53 54 fileSystems."/var/log" = { 55 device = "/dev/disk/by-label/NIXROOT"; 56 fsType = "btrfs"; 57 options = [ "subvol=@log" "noatime" ]; 58 }; 59 60 fileSystems."/swap" = { 61 device = "/dev/disk/by-label/NIXROOT"; 62 fsType = "btrfs"; 63 options = [ "subvol=@swap" "noatime" ]; 64 }; 65 66 fileSystems."/boot" = { 67 device = "/dev/disk/by-label/NIXBOOT"; 68 fsType = "vfat"; 69 options = [ "fmask=0022" "dmask=0022" ]; 70 }; 71 72 swapDevices = [ 73 { device = "/swap/swapfile"; } 74 ]; 75 76 hardware = { 77 enableAllFirmware = true; 78 graphics.enable = true; 79 wirelessRegulatoryDatabase = true; 80 }; 81}