mirror of
https://github.com/NixOS/nix.git
synced 2025-11-21 17:59:36 +01:00
No global settings in libnixfetchers and libnixflake
Progress on #5638
There are still a global fetcher and eval settings, but they are pushed
down into `libnixcmd`, which is a lot less bad a place for this sort of
thing.
Continuing process pioneered in
52bfccf8d8.
This commit is contained in:
parent
b57c361097
commit
3fc77f281e
50 changed files with 401 additions and 271 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#include "users.hh"
|
||||
#include "config-global.hh"
|
||||
#include "flake-settings.hh"
|
||||
#include "flake/settings.hh"
|
||||
#include "flake.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
|
@ -30,7 +30,7 @@ static void writeTrustedList(const TrustedList & trustedList)
|
|||
writeFile(path, nlohmann::json(trustedList).dump());
|
||||
}
|
||||
|
||||
void ConfigFile::apply()
|
||||
void ConfigFile::apply(const Settings & flakeSettings)
|
||||
{
|
||||
std::set<std::string> whitelist{"bash-prompt", "bash-prompt-prefix", "bash-prompt-suffix", "flake-registry", "commit-lock-file-summary", "commit-lockfile-summary"};
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ void ConfigFile::apply()
|
|||
else
|
||||
assert(false);
|
||||
|
||||
if (!whitelist.count(baseName) && !nix::flakeSettings.acceptFlakeConfig) {
|
||||
if (!whitelist.count(baseName) && !flakeSettings.acceptFlakeConfig) {
|
||||
bool trusted = false;
|
||||
auto trustedList = readTrustedList();
|
||||
auto tlname = get(trustedList, name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue