mirror of
https://github.com/nix-community/disko
synced 2024-11-12 23:27:07 +00:00
module: add tests.extraChecks
This commit is contained in:
parent
487a978e34
commit
dd5cdd852c
1 changed files with 11 additions and 0 deletions
11
module.nix
11
module.nix
|
@ -45,6 +45,16 @@ in
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = config.boot.loader.systemd-boot.enable || config.boot.loader.grub.efiSupport;
|
default = config.boot.loader.systemd-boot.enable || config.boot.loader.grub.efiSupport;
|
||||||
};
|
};
|
||||||
|
extraChecks = lib.mkOption {
|
||||||
|
description = ''
|
||||||
|
extra checks to run in the `system.build.installTest`.
|
||||||
|
'';
|
||||||
|
type = lib.types.lines;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
machine.succeed("test -e /var/secrets/my.secret")
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf (cfg.devices.disk != { }) {
|
config = lib.mkIf (cfg.devices.disk != { }) {
|
||||||
|
@ -60,6 +70,7 @@ in
|
||||||
disko-config = builtins.removeAttrs config [ "_module" ];
|
disko-config = builtins.removeAttrs config [ "_module" ];
|
||||||
testMode = "direct";
|
testMode = "direct";
|
||||||
efi = cfg.tests.efi;
|
efi = cfg.tests.efi;
|
||||||
|
extraTestScript = cfg.tests.extraChecks;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue