module: add tests.extraChecks

This commit is contained in:
lassulus 2023-09-02 11:01:41 +02:00 committed by mergify[bot]
parent 487a978e34
commit dd5cdd852c

View File

@ -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;
}; };
}; };