diff options
author | lassulus <lassulus@lassul.us> | 2022-09-30 12:55:28 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2022-10-02 16:41:02 +0200 |
commit | 9f7f23abdb161578316d94f45528fbf47982f4d9 (patch) | |
tree | 92134db7dbe059a7163571e50045b42798a2aea4 /example/lvm-raid.nix | |
parent | a215a1975938fbc04ae8fb14e474304f3200e15c (diff) |
add nixos tests for disko.config, extend/fix existing tests
Diffstat (limited to 'example/lvm-raid.nix')
-rw-r--r-- | example/lvm-raid.nix | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/example/lvm-raid.nix b/example/lvm-raid.nix index 3c5ee69..9d0c9d7 100644 --- a/example/lvm-raid.nix +++ b/example/lvm-raid.nix @@ -1,16 +1,28 @@ -{ +{ disks ? [ "/dev/vdb" "/dev/vdc" ] }: { disk = { - vdb = { + one = { type = "disk"; - device = "/dev/vdb"; + device = builtins.elemAt disks 0; content = { type = "table"; format = "gpt"; partitions = [ { + name = "boot"; + type = "partition"; + start = "0"; + end = "100M"; + fs-type = "fat32"; + bootable = true; + content = { + type = "mdraid"; + name = "boot"; + }; + } + { type = "partition"; name = "primary"; - start = "0%"; + start = "100M"; end = "100%"; content = { type = "lvm_pv"; @@ -20,17 +32,29 @@ ]; }; }; - vdc = { + two = { type = "disk"; - device = "/dev/vdc"; + device = builtins.elemAt disks 1; content = { type = "table"; format = "gpt"; partitions = [ { + name = "boot"; + type = "partition"; + start = "0"; + end = "100M"; + fs-type = "fat32"; + bootable = true; + content = { + type = "mdraid"; + name = "boot"; + }; + } + { type = "partition"; name = "primary"; - start = "0%"; + start = "100M"; end = "100%"; content = { type = "lvm_pv"; @@ -41,6 +65,18 @@ }; }; }; + mdadm = { + boot = { + type = "mdadm"; + level = 1; + metadata = "1.0"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + }; lvm_vg = { pool = { type = "lvm_vg"; |