about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libmain/Makefile.am1
-rw-r--r--src/libmain/shared.cc1
-rw-r--r--src/libstore/gc.cc2
-rw-r--r--src/libstore/globals.cc1
-rw-r--r--src/libstore/globals.hh4
5 files changed, 8 insertions, 1 deletions
diff --git a/src/libmain/Makefile.am b/src/libmain/Makefile.am
index 5b90297fe189..ebf64a2fb92a 100644
--- a/src/libmain/Makefile.am
+++ b/src/libmain/Makefile.am
@@ -8,6 +8,7 @@ AM_CXXFLAGS = \
  -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
  -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
  -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \
+ -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
  -DNIX_VERSION=\"$(VERSION)\" \
  -I$(srcdir)/.. ${aterm_include} -I$(srcdir)/../libutil \
  -I$(srcdir)/../libstore
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index fb24e832980c..d176db7a7855 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -92,6 +92,7 @@ static void initAndRun(int argc, char * * argv)
     nixStateDir = canonPath(getEnv("NIX_STATE_DIR", NIX_STATE_DIR));
     nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db");
     nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR));
+    nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR));
 
     thisSystem = querySetting("system", SYSTEM);
 
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index f25aabb3dce8..d646dd3dec28 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -319,7 +319,7 @@ static void findRoots(const Path & path, bool recurseSymlinks,
 static void addAdditionalRoots(PathSet & roots)
 {
     Path rootFinder = getEnv("NIX_ROOT_FINDER",
-        "/nix/libexec/nix/find-runtime-roots.pl"); /* !!! */
+        nixLibexecDir + "/nix/find-runtime-roots.pl");
 
     if (rootFinder.empty()) return;
     
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index ac8e19b7d46b..f61fe167d870 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -10,6 +10,7 @@ string nixLogDir = "/UNINIT";
 string nixStateDir = "/UNINIT";
 string nixDBPath = "/UNINIT";
 string nixConfDir = "/UNINIT";
+string nixLibexecDir = "/UNINIT";
 
 bool keepFailed = false;
 bool keepGoing = false;
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 408076b751e7..03aaa13d8917 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -28,6 +28,10 @@ extern string nixDBPath;
    stored. */
 extern string nixConfDir;
 
+/* nixLibexecDir is the directory where internal helper programs are
+   stored. */
+extern string nixLibexecDir;
+
 
 
 /* Misc. global flags. */