From 9f7f23abdb161578316d94f45528fbf47982f4d9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 30 Sep 2022 12:55:28 +0200 Subject: add nixos tests for disko.config, extend/fix existing tests --- example/lvm-raid.nix | 50 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) (limited to 'example/lvm-raid.nix') 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"; -- cgit v1.2.3