summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2015-09-30 22:43:06 +0300
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2015-09-30 23:02:21 +0300
commit725a4d67404f4cf204386e52646cf42ecab394b3 (patch)
tree72c74cd8847b397164574ee862c93636f9f76e8a /nixos/modules/installer
parente916273209560b302ab231606babf5ce1c481f08 (diff)
downloadnixlib-725a4d67404f4cf204386e52646cf42ecab394b3.tar
nixlib-725a4d67404f4cf204386e52646cf42ecab394b3.tar.gz
nixlib-725a4d67404f4cf204386e52646cf42ecab394b3.tar.bz2
nixlib-725a4d67404f4cf204386e52646cf42ecab394b3.tar.lz
nixlib-725a4d67404f4cf204386e52646cf42ecab394b3.tar.xz
nixlib-725a4d67404f4cf204386e52646cf42ecab394b3.tar.zst
nixlib-725a4d67404f4cf204386e52646cf42ecab394b3.zip
nixos-install: Don't use NIX_BUILD_HOOK from caller's environment
If nixos-install is run on a machine with `nix.distributedBuilds = true`
the installation will fail at some point like this:

Died at /nix/store/4frhrl31cl7iahlz6vyvysy5dmr6xnh3-nix-1.10/libexec/nix/build-remote.pl line 115, <STDIN> line 1.

This is due to `nix.distributedBuilds` setting
NIX_BUILD_HOOK=/nix/store/.../build-remote.pl in the global environment,
which then gets confused in the minimal chroot created by nixos-install.

To avoid these kinds of issues with build hooks, just disable them in
the chroot.
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/tools/nixos-install.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh
index f7fe6245d6d9..4e10615f902f 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -188,6 +188,9 @@ mkdir -m 0755 -p $mountPoint/bin
 ln -sf @shell@ $mountPoint/bin/sh
 
 
+# Build hooks likely won't function correctly in the minimal chroot; just disable them.
+unset NIX_BUILD_HOOK
+
 # Make the build below copy paths from the CD if possible.  Note that
 # /tmp/root in the chroot is the root of the CD.
 export NIX_OTHER_STORES=/tmp/root/nix:$NIX_OTHER_STORES