about summary refs log tree commit diff
path: root/src/libstore/normalise.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/normalise.cc')
-rw-r--r--src/libstore/normalise.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/normalise.cc b/src/libstore/normalise.cc
index 5c13f04ecbfd..e287914a100c 100644
--- a/src/libstore/normalise.cc
+++ b/src/libstore/normalise.cc
@@ -124,6 +124,12 @@ Path normaliseStoreExpr(const Path & _nePath, PathSet pending)
        non-existing path. */
     env["HOME"] = "/homeless-shelter";
 
+    /* Tell the builder where the Nix store is.  Usually they
+       shouldn't care, but this is useful for purity checking (e.g.,
+       the compiler or linker might only want to accept paths to files
+       in the store or in the build directory). */
+    env["NIX_STORE"] = nixStore;
+
     /* Build the environment. */
     for (StringPairs::iterator i = ne.derivation.env.begin();
          i != ne.derivation.env.end(); i++)