From a5619f1dffbf3600dd16b51e84ae3c999edc439c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 12 Mar 2004 10:45:08 +0000 Subject: * 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. --- src/libstore/normalise.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libstore/normalise.cc') 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++) -- cgit 1.4.1