about summary refs log tree commit diff
path: root/pkgs/stdenv/generic/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/stdenv/generic/setup.sh')
-rw-r--r--pkgs/stdenv/generic/setup.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 21611278c21b0..2dedf46ac2b3b 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -69,8 +69,6 @@ addToEnv()
         export _PATH=$_PATH:$1/bin
     fi
 
-    echo "${envHooks[@]}"
-
     for i in "${envHooks[@]}"; do
         $i $pkg
     done
@@ -92,8 +90,20 @@ export NIX_STRIP_DEBUG=1
 export NIX_CFLAGS_STRIP="-g0 -Wl,-s"
 
 
-# Where is the store?  This is required for purity checking.
-export NIX_STORE=$(dirname $out)/ # !!! hack
+# Do we know where the store is?  This is required for purity checking.
+if test -z "$NIX_STORE"; then
+    echo "Error: you have an old version of Nix that does not set the" \
+        "NIX_STORE variable.  Please upgrade." >&2
+    exit 1
+fi
+
+
+# We also need to know the root of the build directory for purity checking.
+if test -z "$NIX_BUILD_TOP"; then
+    echo "Error: you have an old version of Nix that does not set the" \
+        "NIX_BUILD_TOP variable.  Please upgrade." >&2
+    exit 1
+fi
 
 
 # Set the TZ (timezone) environment variable, otherwise commands like