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.
This commit is contained in:
parent
e606cd412f
commit
737ed88f35
15 changed files with 195 additions and 133 deletions
|
|
@ -34,9 +34,10 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
|
|||
.handler([&]() {
|
||||
std::cout << "The following configuration options are available:\n\n";
|
||||
Table2 tbl;
|
||||
for (const auto & s : settings._getSettings())
|
||||
if (!s.second.isAlias)
|
||||
tbl.emplace_back(s.first, s.second.setting->description);
|
||||
std::map<std::string, Config::SettingInfo> settings;
|
||||
globalConfig.getSettings(settings);
|
||||
for (const auto & s : settings)
|
||||
tbl.emplace_back(s.first, s.second.description);
|
||||
printTable(std::cout, tbl);
|
||||
throw Exit();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue