aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/normalise.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-03-12 10:45:08 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-03-12 10:45:08 +0000
commita5619f1dffbf3600dd16b51e84ae3c999edc439c (patch)
tree4fbebc9352ecb394f396dfad023c56ab694e9fa5 /src/libstore/normalise.cc
parent7f0ed370da62b867d90ba5346f4b9f217fbbe10f (diff)
* Set the NIX_STORE and NIX_BUILD_TOP environment variables in
builders to point to the store and the temporary build directory, respectively. Useful for purity checking. * Also set TEMPDIR, TMPDIR, TEMP, and TEMP to NIX_BUILD_TOP to make sure that tools in the builder store temporary files in the right location.
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 5c13f04ec..e287914a1 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++)