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/zfs-over-legacy.nix | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'example/zfs-over-legacy.nix') diff --git a/example/zfs-over-legacy.nix b/example/zfs-over-legacy.nix index 81a5975..9943278 100644 --- a/example/zfs-over-legacy.nix +++ b/example/zfs-over-legacy.nix @@ -1,15 +1,30 @@ -{ +{ disks ? [ "/dev/vdb" "/dev/vdc" ] }: { disk = { vdb = { type = "disk"; - device = "/dev/vdb"; + device = builtins.elemAt disks 0; content = { type = "table"; format = "gpt"; partitions = [ { type = "partition"; - start = "0%"; + name = "ESP"; + start = "1MiB"; + end = "100MiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + options = [ + "defaults" + ]; + }; + } + { + type = "partition"; + start = "100MiB"; end = "100%"; name = "primary"; bootable = true; @@ -24,7 +39,7 @@ }; vdc = { type = "disk"; - device = "/dev/vdc"; + device = builtins.elemAt disks 1; content = { type = "zfs"; pool = "zroot"; @@ -34,10 +49,16 @@ zpool = { zroot = { type = "zpool"; + rootFsOptions.mountpoint = "none"; datasets = { - zfs_fs = { + "root" = { + zfs_type = "filesystem"; + options.mountpoint = "none"; + }; + "root/zfs_fs" = { zfs_type = "filesystem"; mountpoint = "/zfs_fs"; + options.mountpoint = "/zfs_fs"; options."com.sun:auto-snapshot" = "true"; }; }; -- cgit v1.2.3