-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make self-contained #441
make self-contained #441
Conversation
Not quite sure this fully fixes the problem because what happens if people install nix-direnv not via nix but i.e. use source_url. |
Is it worth considering removing support for installing outside of nix workflows? Installing via nix would expand our possibilities (i.e. we could use jq and this problem would be solved via a simple anti-quotation). The Installation barrier would be higher. We could offset that by pointing at the flake so that they could override the nixpkgs' version with arbitrary commits. Everyone consuming this should have Nix. Nix now has support for flakes everywhere (2.10 being the earliest you can get in nixpkgs). And the whole purpose is to make using flakes/shell.nix easier in a project, so I think it reasonable to say that you must have a devShell set up for this project to use nix-direnv. On the other hand - I can see a circular dependency happening whereby nix-direnv is installed as part of a devShell and so won't be on PATH until the devShell is loaded. |
I was thinking only of the case where the install is via nix. To take this a bit further, we could check if |
f211f25
to
c951a47
Compare
Just discovered https://github.com/abathur/resholve which deals with this in a much nicer way. |
Is there a way to check what version of nix-direnv I am using? I updated to the latest nixpkgs which should be at 3.0.1 with this fix but I want to make sure. I am still running into the error I described in #448 (comment). Edit: Actually this comment: #448 (comment) |
echo $NIX_DIRENV_VERSION in .envrc |
Here is my output: $ direnv allow
direnv: loading ~/Projects/nix-config/.envrc
3.0.1
direnv: using flake
sort: unrecognized option '--check=quiet'
BusyBox v1.36.1 () multi-call binary.
Usage: sort [-nrughMcszbdfiokt] [-o FILE] [-k START[.OFS][OPTS][,END[.OFS][OPTS]] [-t CHAR] [FILE]...
Sort lines of text
-o FILE Output to FILE
-c Check whether input is sorted
-b Ignore leading blanks
-f Ignore case
-i Ignore unprintable characters
-d Dictionary order (blank or alphanumeric only)
-n Sort numbers
-g General numerical sort
-h Sort human readable numbers (2K 1G)
-M Sort month
-V Sort version
-t CHAR Field separator
-k N[,M] Sort by Nth field
-r Reverse sort order
-s Stable (don't sort ties alphabetically)
-u Suppress duplicate lines
-z NUL terminated input and output
direnv: nix-direnv: minimum required bash version is 5.2 (installed: 5.2.21(1)-release)
direnv: error exit status 1 using NixOS |
You are using an old version of nix-direnv. The current version doesn't have this flag. |
This prepends
coreutils
anddirenv
to$PATH
in addition tonix
in order to make this self-contained.Fixes #440.