mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 23:12:44 +01:00
init: Add flag to avoid loading configuration
This commit is contained in:
parent
8c4c2156bd
commit
e05b58b060
6 changed files with 27 additions and 7 deletions
|
|
@ -427,12 +427,13 @@ void assertLibStoreInitialized() {
|
|||
};
|
||||
}
|
||||
|
||||
void initLibStore() {
|
||||
void initLibStore(bool loadConfig) {
|
||||
if (initLibStoreDone) return;
|
||||
|
||||
initLibUtil();
|
||||
|
||||
loadConfFile();
|
||||
if (loadConfig)
|
||||
loadConfFile();
|
||||
|
||||
preloadNSS();
|
||||
|
||||
|
|
|
|||
|
|
@ -1279,9 +1279,10 @@ std::vector<Path> getUserConfigFiles();
|
|||
extern const std::string nixVersion;
|
||||
|
||||
/**
|
||||
* NB: This is not sufficient. You need to call initNix()
|
||||
* @param loadConfig Whether to load configuration from `nix.conf`, `NIX_CONFIG`, etc. May be disabled for unit tests.
|
||||
* @note When using libexpr, and/or libmain, This is not sufficient. See initNix().
|
||||
*/
|
||||
void initLibStore();
|
||||
void initLibStore(bool loadConfig = true);
|
||||
|
||||
/**
|
||||
* It's important to initialize before doing _anything_, which is why we
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue