summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nix/libstore/build.cc4
-rw-r--r--nix/libstore/globals.cc8
-rw-r--r--nix/libstore/globals.hh2
3 files changed, 12 insertions, 2 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 6d90ce9c23..36c6ea8925 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1811,8 +1811,8 @@ void DerivationGoal::startBuilder()
 
         /* Bind-mount a user-configurable set of directories from the
            host file system. */
-        PathSet dirs = tokenizeString<StringSet>(settings.get("build-chroot-dirs", DEFAULT_CHROOT_DIRS));
-        PathSet dirs2 = tokenizeString<StringSet>(settings.get("build-extra-chroot-dirs", ""));
+        PathSet dirs = tokenizeString<StringSet>(settings.get("build-chroot-dirs", string(DEFAULT_CHROOT_DIRS)));
+        PathSet dirs2 = tokenizeString<StringSet>(settings.get("build-extra-chroot-dirs", string("")));
         dirs.insert(dirs2.begin(), dirs2.end());
         for (auto & i : dirs) {
             size_t p = i.find('=');
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index 1cbe912625..bb08a7d0b0 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -130,6 +130,14 @@ Strings Settings::get(const string & name, const Strings & def)
 }
 
 
+bool Settings::get(const string & name, bool def)
+{
+    bool res = def;
+    _get(res, name);
+    return res;
+}
+
+
 void Settings::update()
 {
     _get(tryFallback, "build-fallback");
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh
index 55f082e56e..c17e10d7c3 100644
--- a/nix/libstore/globals.hh
+++ b/nix/libstore/globals.hh
@@ -25,6 +25,8 @@ struct Settings {
 
     Strings get(const string & name, const Strings & def);
 
+    bool get(const string & name, bool def);
+
     void update();
 
     string pack();