diff options
author | obadz <obadz-git@obadz.com> | 2016-08-07 01:17:41 +0100 |
---|---|---|
committer | obadz <obadz-git@obadz.com> | 2016-08-09 21:39:40 +0100 |
commit | 57b7c3c545f35385dbe5a1eab44028f9233b736e (patch) | |
tree | a9271eb62025ef5b69e9ae7e224253d7279b4f39 | |
parent | 918b11e64c99d094f8b91e87f7b7c6b11851ce55 (diff) | |
download | nixlib-57b7c3c545f35385dbe5a1eab44028f9233b736e.tar nixlib-57b7c3c545f35385dbe5a1eab44028f9233b736e.tar.gz nixlib-57b7c3c545f35385dbe5a1eab44028f9233b736e.tar.bz2 nixlib-57b7c3c545f35385dbe5a1eab44028f9233b736e.tar.lz nixlib-57b7c3c545f35385dbe5a1eab44028f9233b736e.tar.xz nixlib-57b7c3c545f35385dbe5a1eab44028f9233b736e.tar.zst nixlib-57b7c3c545f35385dbe5a1eab44028f9233b736e.zip |
nixos-install: more robust way of sourcing fresh version of self
-rw-r--r-- | nixos/modules/installer/tools/nixos-rebuild.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 5ecdcdb3cdb5..e26a9f6cf635 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -214,9 +214,9 @@ fi # Re-execute nixos-rebuild from the Nixpkgs tree. 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 - exec $SHELL -e $p "${origArgs[@]}" + exec $p/bin/nixos-rebuild "${origArgs[@]}" exit 1 fi fi |