1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

getDefaultNixPath: actually respect {restrict,pure}-eval

Previously, getDefaultNixPath was called too early: at initialisation
time, before CLI and config have been processed, when `restrictEval` and
`pureEval` both have their default value `false`. Call it when
initialising the EvalState instead, and use `setDefault`.
This commit is contained in:
Naïm Favier 2023-01-25 15:10:35 +01:00
parent f233fd496d
commit 1cba5984a6
No known key found for this signature in database
GPG key ID: 95AFCE8211908325
4 changed files with 31 additions and 17 deletions

View file

@ -570,7 +570,7 @@ struct EvalSettings : Config
{
EvalSettings();
static Strings getDefaultNixPath();
Strings getDefaultNixPath();
static bool isPseudoUrl(std::string_view s);
@ -580,7 +580,7 @@ struct EvalSettings : Config
"Whether builtin functions that allow executing native code should be enabled."};
Setting<Strings> nixPath{
this, getDefaultNixPath(), "nix-path",
this, {}, "nix-path",
"List of directories to be searched for `<...>` file references."};
Setting<bool> restrictEval{