summaryrefslogtreecommitdiff
path: root/nix/libstore/builtins.cc
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-02-13 22:35:05 +0100
committerMarius Bakke <mbakke@fastmail.com>2017-02-13 22:35:05 +0100
commit424b1ae76901c538457bd3c30d9d9cf67e79855f (patch)
treeacc35c1160625618cd6083e728c6a4ff7e9cccc9 /nix/libstore/builtins.cc
parenta50e03014177d2f00b5b85d3e1c295406f842016 (diff)
parenteae2dbd47ac1f4a201b8584e2f88c30cd28e093a (diff)
Merge branch 'master' into python-tests
Diffstat (limited to 'nix/libstore/builtins.cc')
-rw-r--r--nix/libstore/builtins.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/nix/libstore/builtins.cc b/nix/libstore/builtins.cc
index 7ed75e5079..a5ebb47737 100644
--- a/nix/libstore/builtins.cc
+++ b/nix/libstore/builtins.cc
@@ -21,6 +21,7 @@
#include <globals.hh>
#include <unistd.h>
+#include <cstdlib>
namespace nix {
@@ -41,6 +42,11 @@ static void builtinDownload(const Derivation &drv,
"download", drvPath.c_str(), output.c_str(), NULL
};
+ /* Tell the script what the store file name is, so that
+ 'strip-store-file-name' (used for instance to determine the URL of
+ content-addressed mirrors) works correctly. */
+ setenv("NIX_STORE", settings.nixStore.c_str(), 1);
+
/* XXX: Hack our way to use the 'download' script from 'LIBEXECDIR/guix'
or just 'LIBEXECDIR', depending on whether we're running uninstalled or
not. */