mirror of
https://github.com/nix-community/disko.git
synced 2024-11-09 20:02:37 +03:00
module: add tests.extraChecks
This commit is contained in:
parent
487a978e34
commit
dd5cdd852c
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 New Issue
Block a user