File tree Expand file tree Collapse file tree
nixos/modules/system/activation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 137137 } ;
138138 } ;
139139
140+ system . activation . externalActivationScript = mkOption {
141+ description = ''
142+ Activation script for systems that are not managed by users of the system.
143+
144+ In this scenario, the activation script does not need to be part of the
145+ "top-level" system store path.
146+
147+ In the case of an image, this allows activation-only dependencies to
148+ be omitted from the runtime dependencies.
149+
150+ In case of a mutable system, it may allow a few dependencies to be
151+ to be garbage collected after activation.
152+ '' ;
153+ type = types . package ;
154+ readOnly = true ;
155+ } ;
156+
140157 system . dryActivationScript = mkOption {
141158 description = "The shell script that is to be run when dry-activating a system." ;
142159 readOnly = true ;
238255 rmdir --ignore-fail-on-non-empty /usr/bin /usr
239256 '' ;
240257
258+ system . activation . externalActivationScript =
259+ pkgs . writeScript "activate" (
260+ lib . strings . replaceStrings
261+ [ "@out@" ]
262+ [ "${ config . system . build . toplevel } " ]
263+ config . system . activationScripts . script
264+ ) ;
265+
241266 } ;
242267
243268}
You can’t perform that action at this time.
0 commit comments