diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index 38e6e79f4264a..f8208bc23d3ed 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -113,8 +113,19 @@ in default = []; description = '' A list of packages that should be included in the system - closure but not otherwise made available to users. This is - primarily used by the installation tests. + closure but not otherwise made available to users. + ''; + }; + + system.checks = mkOption { + type = types.listOf types.package; + default = []; + description = '' + A list of packages that are added as dependencies of the activation + script build, for the purpose of validating the configuration. + + Unlike system.extraDependencies, these paths do not + become part of the runtime closure of the system. ''; }; @@ -173,6 +184,8 @@ in "$out/configuration.nix" ''; + system.systemBuilderAttrs.passedTests = concatStringsSep " " config.system.checks; + system.build.toplevel = system; # Traditionally, the option default contained the logic for taking this from