mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
I could not find an example of how to enable swap on a `zfs_volume` but since I made it work I wanted to share it 😁
19 lines
631 B
Nix
19 lines
631 B
Nix
{
|
|
pkgs ? import <nixpkgs> { },
|
|
diskoLib ? pkgs.callPackage ../lib { },
|
|
}:
|
|
diskoLib.testLib.makeDiskoTest {
|
|
inherit pkgs;
|
|
name = "zfs-encrypted-root";
|
|
extraInstallerConfig.networking.hostId = "8425e349";
|
|
extraSystemConfig.networking.hostId = "8425e349";
|
|
disko-config = pkgs.lib.recursiveUpdate (import ../example/zfs-encrypted-root.nix) {
|
|
disko.devices.zpool.zroot.datasets.root.options.keylocation = "file:///tmp/secret.key";
|
|
};
|
|
extraTestScript = ''
|
|
machine.succeed("mountpoint /");
|
|
machine.succeed("mountpoint /nix");
|
|
machine.succeed("swapon --show=NAME | grep /dev/zd"); # i.e. /dev/zd0
|
|
'';
|
|
}
|