summaryrefslogtreecommitdiffstats
path: root/example/btrfs-subvolumes.nix
blob: 02ce2a4e839f0448aa7569b41e767524648adc9b (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
{ disks ? [ "/dev/vdb" ], ... }: {
  disk = {
    vdb = {
      type = "disk";
      device = builtins.elemAt disks 0;
      content = {
        type = "table";
        format = "gpt";
        partitions = [
          {
            type = "partition";
            name = "ESP";
            start = "1MiB";
            end = "128MiB";
            fs-type = "fat32";
            bootable = true;
            content = {
              type = "filesystem";
              format = "vfat";
              mountpoint = "/boot";
            };
          }
          {
            name = "root";
            type = "partition";
            start = "128MiB";
            end = "100%";
            content = {
              type = "btrfs";
              mountpoint = "/";
              subvolumes = [
                "/home"
                "/test"
              ];
            };
          }
        ];
      };
    };
  };
}