aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorChristian Kampka <christian@kampka.net>2020-10-19 23:08:50 +0200
committerChristian Kampka <christian@kampka.net>2020-10-21 13:41:26 +0200
commit461cf2b85601e4510bff303e454059d80b9df8c0 (patch)
tree7483a8d85cc2681f09ca9cdb01fbc0ab2c40b3a3 /src/libstore
parent21244e1062f92c9eb603f9dd5ed8210f159738e9 (diff)
Add NIX_CONFIG env var for applying nix.conf overrides
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/globals.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 1238dc530..4df68d0c9 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -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()