mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 11:36:11 +01:00
Use ambient Nix when available, with a two stage fallback
First, we try to use the ambient Nix version. Then, we try to use $NIX_DIRENV_FALLBACK_NIX, which is set by default, but can also be overridden by the user. Only then, if neither is available, we fail. Fixes #451.
This commit is contained in:
parent
cff4f3cb0f
commit
94def84445
3 changed files with 62 additions and 17 deletions
|
|
@ -311,6 +311,14 @@ invocation or are purely incidental and should not be relied upon.
|
|||
flake's devShell are invalid and nix-direnv has loaded the last known working
|
||||
shell.
|
||||
|
||||
nix-direnv also respects the following environment variables for configuration.
|
||||
|
||||
- `NIX_DIRENV_FALLBACK_NIX`: Can be set to a fallback Nix binary location, to be
|
||||
used when a compatible one isn't available in `PATH`. Defaults to
|
||||
`config.nix.package` if installed via the NixOS module, otherwise needs to be
|
||||
set manually. Leave unset or empty to fail immediately when a Nix
|
||||
implementation can't be found on `PATH`.
|
||||
|
||||
## General direnv tips
|
||||
|
||||
- [Changing where direnv stores its cache][cache_location]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue