From dd5cdd852cc25092ebb29b598f7af037aab393f3 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 2 Sep 2023 11:01:41 +0200 Subject: [PATCH] module: add tests.extraChecks --- module.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/module.nix b/module.nix index 9d5357a..8383d28 100644 --- a/module.nix +++ b/module.nix @@ -45,6 +45,16 @@ in type = lib.types.bool; 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 != { }) { @@ -60,6 +70,7 @@ in disko-config = builtins.removeAttrs config [ "_module" ]; testMode = "direct"; efi = cfg.tests.efi; + extraTestScript = cfg.tests.extraChecks; }; };