greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

kore / nixos / hosts / iris.nix86 lines · 2001B · 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  # Kyun hands out a /32 with an off-subnet gateway; pin it instead of DHCP.
13  networking = {
14    useDHCP = false;
15    nameservers = [ "9.9.9.9" "149.112.112.112" ];
16
17    interfaces.enp0s4.ipv4.addresses = [{ address = config.kore.currentHost.ipv4; prefixLength = 32; }];
18
19    defaultGateway = {
20      address = gateway;
21      interface = "enp0s4";
22    };
23  };
24
25  zramSwap.enable = true;
26  services.journald.settings.Journal.SystemMaxUse = "500M";
27
28  boot = {
29    loader.grub = {
30      efiSupport = true;
31      efiInstallAsRemovable = true;
32    };
33
34    initrd = {
35      systemd.enable = true;
36      availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
37    };
38  };
39
40  disko.devices.disk.main = {
41    type = "disk";
42    device = "/dev/sda";
43    content = {
44      type = "gpt";
45      partitions = {
46        boot = {
47          size = "1M";
48          type = "EF02";
49        };
50        ESP = {
51          size = "512M";
52          type = "EF00";
53          content = {
54            type = "filesystem";
55            format = "vfat";
56            mountpoint = "/boot";
57            mountOptions = [ "umask=0077" ];
58          };
59        };
60        root = {
61          size = "100%";
62          content = {
63            type = "btrfs";
64            extraArgs = [ "-f" ];
65            subvolumes = let
66              options = [ "compress=zstd" "noatime" ];
67            in {
68              "/@" = {
69                mountpoint = "/";
70                mountOptions = options;
71              };
72              "/@nix" = {
73                mountpoint = "/nix";
74                mountOptions = options;
75              };
76              "/@persist" = {
77                mountpoint = "/persist";
78                mountOptions = options;
79              };
80            };
81          };
82        };
83      };
84    };
85  };
86}