summary refs log tree commit diff stats
path: root/hosts/hplappi.nix
blob: d107312377feafdd0526dcf4543d6612edd3ef06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{config, ...}: {
  nixpkgs.config.permittedInsecurePackages = [
    "python3.12-youtube-dl-2021.12.17"
  ];
  role.sils = "laptop";
  sils = {
    disks.enable = false;
    meta = {
      bootPart = "/dev/disk/by-uuid/4064-2D6C";
      globalDataDir = "/srv";
      hostname = "hplappi";
      mainDisk = "/dev/disk/by-uuid/68da1329-f5ea-4f2c-a38e-faffaaaa6b5a";
      rootPart = "/dev/disk/by-uuid/6700d662-29a9-4ea5-8ca6-85d42550b3ab";
      system = "x86_64-linux";
    };
  };
  home-manager.backupFileExtension = "backup";

  boot = {
    initrd = {
      luks.devices."cryptroot" = {
        crypttabExtraOpts = ["fido2-device=auto"];
        device = config.sils.meta.rootPart;
      };
    };
    resumeDevice = config.sils.meta.mainDisk;
    kernelParams = ["resume_offset=369403136"];
  };

  fileSystems = {
    "/" = {
      device = "tmpfs";
      fsType = "tmpfs";
      options = ["defaults" "size=2G" "mode=755"];
    };
    "/tmp" = {
      device = "tmpfs";
      fsType = "tmpfs";
      options = ["defaults" "size=5G" "mode=755"];
    };
    "/nix" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=nix" "compress-force=zstd"];
    };
    "/etc/NetworkManager" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=networkmanagerconfig" "compress-force=zstd"];
    };
    "/etc/secureboot" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=secureboot" "compress-force=zstd"];
    };
    "/etc/nixos" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=nixconfig" "compress-force=zstd"];
    };
    "/srv" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=srv" "compress-force=zstd"];
      neededForBoot = true;
    };
    "/swap" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=swap" "noatime"];
    };
    "/home" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=home" "compress-force=zstd"];
    };
    "/srv/snapshots" = {
      device = config.sils.meta.mainDisk;
      fsType = "btrfs";
      options = ["subvol=snapshots" "compress-force=zstd"];
    };
    "/boot" = {
      device = config.sils.meta.bootPart;
      fsType = "vfat";
    };
  };

  swapDevices = [
    {
      device = "/swap/swapfile";
    }
  ];
}