diff --git a/example/zfs-encrypted-root.nix b/example/zfs-encrypted-root.nix index cb60a70..36b611f 100644 --- a/example/zfs-encrypted-root.nix +++ b/example/zfs-encrypted-root.nix @@ -56,6 +56,24 @@ options.mountpoint = "/nix"; mountpoint = "/nix"; }; + + # README MORE: https://wiki.archlinux.org/title/ZFS#Swap_volume + "root/swap" = { + type = "zfs_volume"; + size = "10M"; + content = { + type = "swap"; + }; + options = { + volblocksize = "4096"; + compression = "zle"; + logbias = "throughput"; + sync = "always"; + primarycache = "metadata"; + secondarycache = "none"; + "com.sun:auto-snapshot" = "false"; + }; + }; }; }; }; diff --git a/tests/zfs-encrypted-root.nix b/tests/zfs-encrypted-root.nix index 113625b..a196d06 100644 --- a/tests/zfs-encrypted-root.nix +++ b/tests/zfs-encrypted-root.nix @@ -13,5 +13,6 @@ diskoLib.testLib.makeDiskoTest { extraTestScript = '' machine.succeed("mountpoint /"); machine.succeed("mountpoint /nix"); + machine.succeed("swapon --show=NAME | grep /dev/zd"); # i.e. /dev/zd0 ''; }