summaryrefslogtreecommitdiffstats
path: root/example/zfs-over-legacy.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-09-30 12:55:28 +0200
committerlassulus <lassulus@lassul.us>2022-10-02 16:41:02 +0200
commit9f7f23abdb161578316d94f45528fbf47982f4d9 (patch)
tree92134db7dbe059a7163571e50045b42798a2aea4 /example/zfs-over-legacy.nix
parenta215a1975938fbc04ae8fb14e474304f3200e15c (diff)
add nixos tests for disko.config, extend/fix existing tests
Diffstat (limited to 'example/zfs-over-legacy.nix')
-rw-r--r--example/zfs-over-legacy.nix31
1 files changed, 26 insertions, 5 deletions
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";
};
};