mirror of
https://github.com/NixOS/nix
synced 2025-06-29 23:13:14 +02:00
config: use all of XDG_CONFIG_DIRS
Previously, config would only be read from XDG_CONFIG_HOME. This change allows reading config from additional directories, which enables e.g. per-project binary caches or chroot stores with the help of direnv.
This commit is contained in:
parent
7a9ac91a43
commit
f3b8173a93
3 changed files with 17 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue