greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

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