Skip to content

Commit 6adab4c

Browse files
committed
nixos/top-level.nix: Add system.checks
1 parent eb3fc9a commit 6adab4c

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

nixos/modules/system/activation/top-level.nix

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,19 @@ in
113113
default = [];
114114
description = ''
115115
A list of packages that should be included in the system
116-
closure but not otherwise made available to users. This is
117-
primarily used by the installation tests.
116+
closure but not otherwise made available to users.
117+
'';
118+
};
119+
120+
system.checks = mkOption {
121+
type = types.listOf types.package;
122+
default = [];
123+
description = ''
124+
A list of packages that are added as dependencies of the activation
125+
script build, for the purpose of validating the configuration.
126+
127+
Unlike <literal>system.extraDependencies</literal>, these paths do not
128+
become part of the runtime closure of the system.
118129
'';
119130
};
120131

@@ -173,6 +184,8 @@ in
173184
"$out/configuration.nix"
174185
'';
175186

187+
system.systemBuilderAttrs.passedTests = concatStringsSep " " config.system.checks;
188+
176189
system.build.toplevel = system;
177190

178191
# Traditionally, the option default contained the logic for taking this from

0 commit comments

Comments
 (0)