diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-03-27 18:41:31 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-05-30 13:28:01 +0200 |
commit | 737ed88f35ffddb2cb0d5e4b192e20a7b9439682 (patch) | |
tree | 1ac3d1cfa751d5745a9c8ffe9d4ec5404ef211d5 /src/libmain | |
parent | e606cd412f6ad0622feff55dc2a023dc4b2fe238 (diff) |
Modularize config settings
Allow global config settings to be defined in multiple Config
classes. For example, this means that libutil can have settings and
evaluator settings can be moved out of libstore. The Config classes
are registered in a new GlobalConfig class to which config files
etc. are applied.
Relevant to https://github.com/NixOS/nix/issues/2009 in that it
removes the need for ad hoc handling of useCaseHack, which was the
underlying cause of that issue.
Diffstat (limited to 'src/libmain')
-rw-r--r-- | src/libmain/common-args.cc | 4 | ||||
-rw-r--r-- | src/libmain/shared.cc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libmain/common-args.cc b/src/libmain/common-args.cc index bcc05c2cd..4c35a4199 100644 --- a/src/libmain/common-args.cc +++ b/src/libmain/common-args.cc @@ -29,14 +29,14 @@ MixCommonArgs::MixCommonArgs(const string & programName) .arity(2) .handler([](std::vector<std::string> ss) { try { - settings.set(ss[0], ss[1]); + globalConfig.set(ss[0], ss[1]); } catch (UsageError & e) { warn(e.what()); } }); std::string cat = "config"; - settings.convertToArgs(*this, cat); + globalConfig.convertToArgs(*this, cat); // Backward compatibility hack: nix-env already had a --system flag. if (programName == "nix-env") longFlags.erase("system"); diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 91a4eaf92..4ed34e54d 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -109,7 +109,7 @@ void initNix() opensslLocks = std::vector<std::mutex>(CRYPTO_num_locks()); CRYPTO_set_locking_callback(opensslLockCallback); - settings.loadConfFile(); + loadConfFile(); startSignalHandlerThread(); |