Skip to content

Commit

Permalink
document default values for nix-path
Browse files Browse the repository at this point in the history
also note how it's overridden and note the effect of `restrict-eval`
  • Loading branch information
fricklerhandwerk committed Oct 7, 2023
1 parent 3fa4fb5 commit a1b4bc1
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/libexpr/eval-settings.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,26 @@ struct EvalSettings : Config
Setting<Strings> nixPath{
this, getDefaultNixPath(), "nix-path",
R"(
List of directories to be searched for `<...>` file references
In particular, outside of [pure evaluation mode](#conf-pure-eval), this determines the value of
List of search paths to use for lookup paths.
This setting determines the value of
[`builtins.nixPath`](@docroot@/language/builtin-constants.md#builtins-nixPath).
)"};
The default value is
```
$HOME/.nix-defexpr/channels
nixpkgs=$NIX_STATE_DIR/profiles/per-user/root/channels/nixpkgs
$NIX_STATE_DIR/profiles/per-user/root/channels
```
It can be overridden with the [`NIX_PATH` environment variable](@docroot@/command-ref/env-common.md#env-NIX_PATH) or the [`-I` command line option](@docroot@/command-ref/opt-common.md#opt-I).
> **Note**
>
> If [restricted evaluation](#conf-restrict-eval) is enabled, the default value is ignored.
>
> If [pure evaluation](#conf-pure-eval) is enabled, lookup paths are not resolved at all.
)", {}, false};

Setting<bool> restrictEval{
this, false, "restrict-eval",
Expand Down

0 comments on commit a1b4bc1

Please sign in to comment.