about summary refs log tree commit diff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-10-31T11·37+0100
committerGitHub <noreply@github.com>2018-10-31T11·37+0100
commitfb35aaa42295940ca8dbfef17b081729636f9775 (patch)
tree1b616ccaa8c3608970f23a0885199c426ed43ff6 /src/libstore/globals.cc
parent38d76d6d78e691c5ede8b929cf41ffe849349a8e (diff)
parentf3b8173a93a3571046ef6765afe1a15efc1e0de6 (diff)
Merge pull request #2501 from mayflower/xdg_config_dirs
config: use all of XDG_CONFIG_DIRS
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r--src/libstore/globals.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index a9c07b23a6f3..1c2c08715a14 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -78,7 +78,11 @@ void loadConfFile()
        ~/.nix/nix.conf or the command line. */
     globalConfig.resetOverriden();
 
-    globalConfig.applyConfigFile(getConfigDir() + "/nix/nix.conf");
+    auto dirs = getConfigDirs();
+    // Iterate over them in reverse so that the ones appearing first in the path take priority
+    for (auto dir = dirs.rbegin(); dir != dirs.rend(); dir++) {
+        globalConfig.applyConfigFile(*dir + "/nix/nix.conf");
+    }
 }
 
 unsigned int Settings::getDefaultCores()