-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use ambient Nix when available, with a two stage fallback #513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. I appreciate the effort.
I will wait for @Mic92 to have a chance to review before I merge (though they may get around to it first).
prologue = | ||
(writeText "prologue.sh" '' | ||
NIX_DIRENV_SKIP_VERSION_CHECK=1 | ||
NIX_DIRENV_FALLBACK_NIX=''${NIX_DIRENV_FALLBACK_NIX:-${lib.getExe nix}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you mention this environment variable in the README? Otherwise it looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
8494447
to
d7803d9
Compare
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 nix-community#451.
d7803d9
to
94def84
Compare
@mergify queue |
🛑 The pull request has been merged manuallyThe pull request has been merged manually at a3139c8 |
Is it just broken now...? |
"required checks" in mergify.yml needs an update. |
Upstream recently changed their resholve solutions somewhat to support using the ambient Nix on the user's `$PATH` or falling back to the default nixpkgs stable `nix` otherwise. Let's update our definitions to match. See: nix-community/nix-direnv#513
Upstream recently changed their resholve solutions somewhat to support using the ambient Nix on the user's `$PATH` or falling back to the default nixpkgs stable `nix` otherwise. Let's update our definitions to match. See: nix-community/nix-direnv#513 (cherry picked from commit ea8ab50)
Upstream recently changed their resholve solutions somewhat to support using the ambient Nix on the user's `$PATH` or falling back to the default nixpkgs stable `nix` otherwise. Let's update our definitions to match. See: nix-community/nix-direnv#513 (cherry picked from commit ea8ab50)
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.