greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

kore / nixos / hosts / peony.nix79 lines · 1799B · raw

1{ inputs, modulesPath, ... }:
2
3{
4  imports = [
5    inputs.disko.nixosModules.disko
6
7    ( modulesPath + "/installer/scan/not-detected.nix" )
8  ];
9
10  boot = {
11    kernelModules = [ "kvm-intel" ];
12
13    loader = {
14      systemd-boot = {
15        enable = true;
16        editor = false;
17      };
18      efi.canTouchEfiVariables = true;
19    };
20
21    initrd = {
22      systemd.enable = true;
23      availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
24    };
25  };
26
27  hardware = {
28    graphics.enable = true;
29    cpu.intel.updateMicrocode = true;
30  };
31
32  disko.devices.disk.main = {
33    type = "disk";
34    device = "/dev/sda";
35    content = {
36      type = "gpt";
37      partitions = {
38        ESP = {
39          size = "512M";
40          type = "EF00";
41          content = {
42            type = "filesystem";
43            format = "vfat";
44            mountpoint = "/boot";
45            mountOptions = [ "umask=0077" ];
46          };
47        };
48        luks = {
49          size = "100%";
50          content = {
51            type = "luks";
52            name = "crypted";
53            settings.allowDiscards = true;
54            content = {
55              type = "btrfs";
56              extraArgs = [ "-f" ];
57              subvolumes = let
58                options = [ "compress=zstd" "noatime" "ssd" "discard=async" ];
59              in {
60                "/@" = {
61                  mountpoint = "/";
62                  mountOptions = options;
63                };
64                "/@nix" = {
65                  mountpoint = "/nix";
66                  mountOptions = options;
67                };
68                "/@persist" = {
69                  mountpoint = "/persist";
70                  mountOptions = options;
71                };
72              };
73            };
74          };
75        };
76      };
77    };
78  };
79}