Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions nixos/modules/system/activation/activatable-system.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ let
;

systemBuilderArgs = {
passAsFile = [
"activationScript"
"dryActivationScript"
];
activationScript = config.system.activationScripts.script;
dryActivationScript = config.system.dryActivationScript;
};
Expand Down Expand Up @@ -54,8 +58,8 @@ in
};
config = {
system.activatableSystemBuilderCommands = ''
echo "$activationScript" > $out/activate
echo "$dryActivationScript" > $out/dry-activate
mv "$activationScriptPath" $out/activate
mv "$dryActivationScriptPath" $out/dry-activate
substituteInPlace $out/activate --subst-var-by out ''${!toplevelVar}
substituteInPlace $out/dry-activate --subst-var-by out ''${!toplevelVar}
chmod u+x $out/activate $out/dry-activate
Expand Down
6 changes: 5 additions & 1 deletion nixos/modules/system/activation/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ let
name = "nixos-system-${config.system.name}-${config.system.nixos.label}";
preferLocalBuild = true;
allowSubstitutes = false;
passAsFile = [ "extraDependencies" ];
buildCommand = systemBuilder;

systemd = config.systemd.package;
Expand Down Expand Up @@ -386,6 +385,11 @@ in
# to the system closure, which defeats the purpose of the `system.checks`
# option, as opposed to `system.extraDependencies`.
passedChecks = concatStringsSep " " config.system.checks;

# Define `passAsFile` here, rather than in the body of `baseSystem`, so
# that it can be augmented with "activationScript" and
# "dryActivationScript" in `./activatable-system.nix`.
passAsFile = [ "extraDependencies" ];
}
// lib.optionalAttrs (config.system.forbiddenDependenciesRegexes != [ ]) {
closureInfo = pkgs.closureInfo {
Expand Down