1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 05:11:47 +02:00

Merge pull request #2501 from mayflower/xdg_config_dirs

config: use all of XDG_CONFIG_DIRS
This commit is contained in:
Eelco Dolstra 2018-10-31 12:37:23 +01:00 committed by GitHub
commit fb35aaa422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -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()