greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

kore / nixos / hosts / iris.nix84 lines · 1873B · raw

1{ inputs, config, modulesPath, ... }:
2
3let
4  gateway = "100.213.253.237";
5in {
6  imports = [
7    inputs.disko.nixosModules.disko
8
9    ( modulesPath + "/profiles/qemu-guest.nix" )
10  ];
11
12  networking = {
13    useDHCP = false;
14
15    interfaces.enp0s4.ipv4.addresses = [{ address = config.kore.currentHost.ipv4; prefixLength = 32; }];
16
17    defaultGateway = {
18      address = gateway;
19      interface = "enp0s4";
20    };
21  };
22
23  zramSwap.enable = true;
24  services.journald.settings.Journal.SystemMaxUse = "500M";
25
26  boot = {
27    loader.grub = {
28      efiSupport = true;
29      efiInstallAsRemovable = true;
30    };
31
32    initrd = {
33      systemd.enable = true;
34      availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
35    };
36  };
37
38  disko.devices.disk.main = {
39    type = "disk";
40    device = "/dev/sda";
41    content = {
42      type = "gpt";
43      partitions = {
44        boot = {
45          size = "1M";
46          type = "EF02";
47        };
48        ESP = {
49          size = "512M";
50          type = "EF00";
51          content = {
52            type = "filesystem";
53            format = "vfat";
54            mountpoint = "/boot";
55            mountOptions = [ "umask=0077" ];
56          };
57        };
58        root = {
59          size = "100%";
60          content = {
61            type = "btrfs";
62            extraArgs = [ "-f" ];
63            subvolumes = let
64              options = [ "compress=zstd" "noatime" ];
65            in {
66              "/@" = {
67                mountpoint = "/";
68                mountOptions = options;
69              };
70              "/@nix" = {
71                mountpoint = "/nix";
72                mountOptions = options;
73              };
74              "/@persist" = {
75                mountpoint = "/persist";
76                mountOptions = options;
77              };
78            };
79          };
80        };
81      };
82    };
83  };
84}