Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 1 | { |
| 2 | lib, |
| 3 | pkgs, |
| 4 | inputs, |
| 5 | system, |
| 6 | target, |
| 7 | format, |
| 8 | virtual, |
| 9 | systems, |
| 10 | config, |
| 11 | ... |
| 12 | }: |
| 13 | { |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 14 | networking.hostName = "greylag"; |
| 15 | boot.loader.systemd-boot.enable = true; |
| 16 | boot.loader.efi.canTouchEfiVariables = true; |
| 17 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 18 | boot.initrd.availableKernelModules = [ |
| 19 | "xhci_pci" |
| 20 | "thunderbolt" |
| 21 | "nvme" |
| 22 | "uas" |
| 23 | "usbhid" |
| 24 | "sd_mod" |
| 25 | "ext4" |
| 26 | ]; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 27 | boot.initrd.kernelModules = [ ]; |
| 28 | boot.kernelModules = [ "kvm-intel" ]; |
| 29 | boot.extraModulePackages = [ ]; |
| 30 | |
| 31 | boot.initrd.systemd.enable = true; # needed for the way we do our YubiKey |
| 32 | boot.initrd.luks.devices."key".device = "/dev/disk/by-label/KEY"; |
| 33 | |
| 34 | boot.initrd.luks.devices."luks-expansion0" = { |
| 35 | device = "/dev/disk/by-label/EXPANSION0"; |
| 36 | keyFile = "/key:/dev/mapper/key"; |
| 37 | }; |
| 38 | boot.initrd.luks.devices."luks-ssd0" = { |
| 39 | device = "/dev/disk/by-label/SSD0"; |
| 40 | keyFile = "/key:/dev/mapper/key"; |
| 41 | }; |
| 42 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 43 | fileSystems = |
| 44 | (lib.mapAttrs |
| 45 | (_: share_name: { |
| 46 | device = "/dev/disk/by-label/BTRFS0"; |
| 47 | fsType = "btrfs"; |
| 48 | options = [ |
| 49 | "subvol=shared/${share_name}" |
| 50 | "compress=zstd:1" |
| 51 | ]; |
| 52 | }) |
| 53 | { |
| 54 | "/home/minion/Code" = "@Code"; |
| 55 | "/var/lib/containers" = "@containers"; |
| 56 | "/etc/NetworkManager" = "@NetworkManager"; |
| 57 | "/home/minion/.local/share/containers/storage" = "@personal-containers"; |
| 58 | "/home/minion/.gtimelog" = "@gtimelog"; |
| 59 | "/home/minion/Documents" = "@documents"; |
| 60 | } |
| 61 | ) |
| 62 | // { |
| 63 | "/mnt" = { |
| 64 | device = "/dev/mapper/key"; |
| 65 | fsType = "ext4"; |
| 66 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 67 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 68 | "/" = { |
| 69 | device = "/dev/disk/by-label/BTRFS0"; |
| 70 | fsType = "btrfs"; |
| 71 | options = [ |
| 72 | "subvol=@nixos" |
| 73 | "compress=zstd:1" |
| 74 | ]; |
| 75 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 76 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 77 | "/var" = { |
| 78 | device = "/dev/disk/by-label/BTRFS0"; |
| 79 | fsType = "btrfs"; |
| 80 | options = [ |
| 81 | "subvol=@nixos-var" |
| 82 | "compress=zstd:1" |
| 83 | ]; |
| 84 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 85 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 86 | "/home" = { |
| 87 | device = "/dev/disk/by-label/BTRFS0"; |
| 88 | fsType = "btrfs"; |
| 89 | options = [ |
| 90 | "subvol=@nixos-home" |
| 91 | "compress=zstd:1" |
| 92 | ]; |
| 93 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 94 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 95 | "/nix" = { |
| 96 | device = "/dev/disk/by-label/BTRFS0"; |
| 97 | fsType = "btrfs"; |
| 98 | options = [ |
| 99 | "subvol=@nixos-nix" |
| 100 | "compress=zstd:1" |
| 101 | ]; |
| 102 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 103 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 104 | "/boot" = { |
| 105 | device = "/dev/disk/by-label/ESP"; |
| 106 | fsType = "vfat"; |
| 107 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 108 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 109 | |
| 110 | swapDevices = [ ]; |
| 111 | |
| 112 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking |
| 113 | # (the default) this is the recommended approach. When using systemd-networkd it's |
| 114 | # still possible to use this option, but it's recommended to use it in conjunction |
| 115 | # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. |
| 116 | networking.useDHCP = lib.mkDefault true; |
| 117 | # networking.interfaces.enp0s13f0u4u4u4.useDHCP = lib.mkDefault true; |
| 118 | # networking.interfaces.wlp166s0.useDHCP = lib.mkDefault true; |
| 119 | |
| 120 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; |
| 121 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame^] | 122 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 123 | } |