1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 11:43:15 +02:00

Add NIX_CONFIG env var for applying nix.conf overrides

This commit is contained in:
Christian Kampka 2020-10-19 23:08:50 +02:00
parent 21244e1062
commit 461cf2b856
No known key found for this signature in database
GPG key ID: B88E140DB4FE1AA5
4 changed files with 23 additions and 0 deletions

View file

@ -86,6 +86,12 @@ void loadConfFile()
for (auto file = files.rbegin(); file != files.rend(); file++) {
globalConfig.applyConfigFile(*file);
}
auto nixConfEnv = getEnv("NIX_CONFIG");
if (nixConfEnv.has_value()) {
globalConfig.applyConfig(nixConfEnv.value(), "NIX_CONFIG");
}
}
std::vector<Path> getUserConfigFiles()