summaryrefslogtreecommitdiffstats
path: root/lass/1systems/hilum/disk.nix
blob: 9264016489070eea8359971f3d223998723a9a9d (plain)
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
{ lib, disk, keyFile, ... }:
{
  disk = {
    main = {
      type = "disk";
      device = disk;
      content = {
        type = "table";
        format = "gpt";
        partitions = [
          {
            name = "boot";
            type = "partition";
            start = "0";
            end = "1M";
            part-type = "primary";
            flags = ["bios_grub"];
          }
          {
            type = "partition";
            name = "ESP";
            start = "1MiB";
            end = "50%";
            fs-type = "fat32";
            bootable = true;
            content = {
              type = "filesystem";
              format = "vfat";
              mountpoint = "/boot";
            };
          }
          {
            name = "root";
            type = "partition";
            start = "50%";
            end = "100%";
            content = {
              type = "luks";
              name = "hilum_luks";
              keyFile = keyFile;
              content = {
                type = "filesystem";
                format = "xfs";
                mountpoint = "/";
              };
            };
          }
        ];
      };
    };
  };
}