nixos copySystemConfiguration: fix when chrooted
Fixes #7974. Also makes the description more informative.
This commit is contained in:
parent
3c84ae406d
commit
f8516a0717
@ -178,9 +178,10 @@ in
|
|||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
If enabled, copies the NixOS configuration file
|
If enabled, copies the NixOS configuration file
|
||||||
<literal>$NIXOS_CONFIG</literal> (usually
|
(usually <filename>/etc/nixos/configuration.nix</filename>)
|
||||||
<filename>/etc/nixos/configuration.nix</filename>)
|
and links it from the resulting system
|
||||||
to the system store path.
|
(getting to <filename>/run/current-system/configuration.nix</filename>).
|
||||||
|
Note that only this single file is copied, even if it imports others.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -238,7 +239,9 @@ in
|
|||||||
system.extraSystemBuilderCmds =
|
system.extraSystemBuilderCmds =
|
||||||
optionalString
|
optionalString
|
||||||
config.system.copySystemConfiguration
|
config.system.copySystemConfiguration
|
||||||
"cp ${maybeEnv "NIXOS_CONFIG" "/etc/nixos/configuration.nix"} $out";
|
''ln -s '${import ../../../lib/from-env.nix "NIXOS_CONFIG" <nixos-config>}' \
|
||||||
|
"$out/configuration.nix"
|
||||||
|
'';
|
||||||
|
|
||||||
system.build.toplevel = system;
|
system.build.toplevel = system;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user