···178178 default = false;
179179 description = ''
180180 If enabled, copies the NixOS configuration file
181181- <literal>$NIXOS_CONFIG</literal> (usually
182182- <filename>/etc/nixos/configuration.nix</filename>)
183183- to the system store path.
181181+ (usually <filename>/etc/nixos/configuration.nix</filename>)
182182+ and links it from the resulting system
183183+ (getting to <filename>/run/current-system/configuration.nix</filename>).
184184+ Note that only this single file is copied, even if it imports others.
184185 '';
185186 };
186187···238239 system.extraSystemBuilderCmds =
239240 optionalString
240241 config.system.copySystemConfiguration
241241- "cp ${maybeEnv "NIXOS_CONFIG" "/etc/nixos/configuration.nix"} $out";
242242+ ''ln -s '${import ../../../lib/from-env.nix "NIXOS_CONFIG" <nixos-config>}' \
243243+ "$out/configuration.nix"
244244+ '';
242245243246 system.build.toplevel = system;
244247