nixos-install: more robust way of sourcing fresh version of self
This commit is contained in:
parent
918b11e64c
commit
57b7c3c545
|
@ -214,9 +214,9 @@ fi
|
||||||
|
|
||||||
# Re-execute nixos-rebuild from the Nixpkgs tree.
|
# Re-execute nixos-rebuild from the Nixpkgs tree.
|
||||||
if [ -z "$_NIXOS_REBUILD_REEXEC" -a -n "$canRun" ]; then
|
if [ -z "$_NIXOS_REBUILD_REEXEC" -a -n "$canRun" ]; then
|
||||||
if p=$(nix-instantiate --find-file nixpkgs/nixos/modules/installer/tools/nixos-rebuild.sh "${extraBuildFlags[@]}"); then
|
if p=$(nix-build --no-out-link --expr 'with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild' "${extraBuildFlags[@]}"); then
|
||||||
export _NIXOS_REBUILD_REEXEC=1
|
export _NIXOS_REBUILD_REEXEC=1
|
||||||
exec $SHELL -e $p "${origArgs[@]}"
|
exec $p/bin/nixos-rebuild "${origArgs[@]}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue