blob: 1d2532e69bcd3591d840b8aa7349ac54e0ba22c7 [file] [log] [blame]
Skyler Grey4e230892024-02-13 22:58:46 +00001{
2 lib,
3 pkgs,
4 inputs,
5 system,
6 target,
7 format,
8 virtual,
9 systems,
10 config,
11 ...
12}:
13{
Skyler Greya0da6b22024-02-11 22:53:41 +000014 networking.hostName = "greylag";
15 boot.loader.systemd-boot.enable = true;
16 boot.loader.efi.canTouchEfiVariables = true;
17
Skyler Grey4e230892024-02-13 22:58:46 +000018 boot.initrd.availableKernelModules = [
19 "xhci_pci"
20 "thunderbolt"
21 "nvme"
22 "uas"
23 "usbhid"
24 "sd_mod"
25 "ext4"
26 ];
Skyler Greya0da6b22024-02-11 22:53:41 +000027 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 Grey4e230892024-02-13 22:58:46 +000043 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 Greya0da6b22024-02-11 22:53:41 +000067
Skyler Grey4e230892024-02-13 22:58:46 +000068 "/" = {
69 device = "/dev/disk/by-label/BTRFS0";
70 fsType = "btrfs";
71 options = [
72 "subvol=@nixos"
73 "compress=zstd:1"
74 ];
75 };
Skyler Greya0da6b22024-02-11 22:53:41 +000076
Skyler Grey4e230892024-02-13 22:58:46 +000077 "/var" = {
78 device = "/dev/disk/by-label/BTRFS0";
79 fsType = "btrfs";
80 options = [
81 "subvol=@nixos-var"
82 "compress=zstd:1"
83 ];
84 };
Skyler Greya0da6b22024-02-11 22:53:41 +000085
Skyler Grey4e230892024-02-13 22:58:46 +000086 "/home" = {
87 device = "/dev/disk/by-label/BTRFS0";
88 fsType = "btrfs";
89 options = [
90 "subvol=@nixos-home"
91 "compress=zstd:1"
92 ];
93 };
Skyler Greya0da6b22024-02-11 22:53:41 +000094
Skyler Grey4e230892024-02-13 22:58:46 +000095 "/nix" = {
96 device = "/dev/disk/by-label/BTRFS0";
97 fsType = "btrfs";
98 options = [
99 "subvol=@nixos-nix"
100 "compress=zstd:1"
101 ];
102 };
Skyler Greya0da6b22024-02-11 22:53:41 +0000103
Skyler Grey4e230892024-02-13 22:58:46 +0000104 "/boot" = {
105 device = "/dev/disk/by-label/ESP";
106 fsType = "vfat";
107 };
Skyler Greya0da6b22024-02-11 22:53:41 +0000108 };
Skyler Greya0da6b22024-02-11 22:53:41 +0000109
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 Grey4e230892024-02-13 22:58:46 +0000122 hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
Skyler Greya0da6b22024-02-11 22:53:41 +0000123}