diff options
author | Linus Heckemann <git@sphalerite.org> | 2017-07-12 22:03:53 +0100 |
---|---|---|
committer | Linus Heckemann <git@sphalerite.org> | 2017-07-13 06:26:44 +0100 |
commit | 8b1f1d93fa8e3524e0e01378dbe813e6eb06712e (patch) | |
tree | 67d3e92743f3e06438519aaab35b17c4f1862f20 /nixos/modules/installer/tools | |
parent | 598d79ae7d3d53d4bb4e317cb8f8a035c7151b35 (diff) | |
download | nixlib-8b1f1d93fa8e3524e0e01378dbe813e6eb06712e.tar nixlib-8b1f1d93fa8e3524e0e01378dbe813e6eb06712e.tar.gz nixlib-8b1f1d93fa8e3524e0e01378dbe813e6eb06712e.tar.bz2 nixlib-8b1f1d93fa8e3524e0e01378dbe813e6eb06712e.tar.lz nixlib-8b1f1d93fa8e3524e0e01378dbe813e6eb06712e.tar.xz nixlib-8b1f1d93fa8e3524e0e01378dbe813e6eb06712e.tar.zst nixlib-8b1f1d93fa8e3524e0e01378dbe813e6eb06712e.zip |
nixos-install: only search for nixpkgs when needed
Diffstat (limited to 'nixos/modules/installer/tools')
-rw-r--r-- | nixos/modules/installer/tools/nixos-install.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index 087fbcd4512f..7fae915871e4 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -106,8 +106,11 @@ extraBuildFlags+=(--option "build-users-group" "$buildUsersGroup") binary_caches="$(@perl@/bin/perl -I @nix@/lib/perl5/site_perl/*/* -e 'use Nix::Config; Nix::Config::readConfig; print $Nix::Config::config{"binary-caches"};')" extraBuildFlags+=(--option "binary-caches" "$binary_caches") -nixpkgs="$(readlink -f "$(nix-instantiate --find-file nixpkgs)")" -export NIX_PATH="nixpkgs=$nixpkgs:nixos-config=$mountPoint/$NIXOS_CONFIG" +# We only need nixpkgs in the path if we don't already have a system closure to install +if [[ -z "$closure" ]]; then + nixpkgs="$(readlink -f "$(nix-instantiate --find-file nixpkgs)")" + export NIX_PATH="nixpkgs=$nixpkgs:nixos-config=$mountPoint/$NIXOS_CONFIG" +fi unset NIXOS_CONFIG # TODO: do I need to set NIX_SUBSTITUTERS here or is the --option binary-caches above enough? |