diff options
Diffstat (limited to 'example/luks-lvm.nix')
-rw-r--r-- | example/luks-lvm.nix | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/example/luks-lvm.nix b/example/luks-lvm.nix new file mode 100644 index 0000000..a6879ce --- /dev/null +++ b/example/luks-lvm.nix @@ -0,0 +1,76 @@ +{ 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 = "100MiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + } + { + type = "partition"; + name = "luks"; + start = "100MiB"; + end = "100%"; + content = { + type = "luks"; + name = "crypted"; + keyFile = "/tmp/secret.key"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + } + ]; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + type = "lvm_lv"; + size = "100M"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + home = { + type = "lvm_lv"; + size = "10M"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/home"; + }; + }; + raw = { + type = "lvm_lv"; + size = "10M"; + }; + }; + }; + }; +} |