-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
nix-direnv should not bundle nix #451
Comments
Here is my take: It should be bundled but $PATH should be preferred. |
To improve the situation on nixos: https://github.com/NixOS/nixpkgs/pull/275591/files |
That's alright too, though imo it's just an unnecessary dependency. If your system nix version is different, it will cause you to have two different versions of nix in your system closure. I can understand why someone would not have |
It can happen in non-interactive situations i.e. if you run it from systemd services. |
This has caused a ton of hard to debug issues in our company where people installed nix-direnv through |
Why would someone be using nix-direnv without nix on $PATH? What is the use case there? (Further - why shouldn't direnv be on $PATH? You can come up with a bunch of esoteric reasons - but "it used to work" isn't generally a good enough reason to continue to support the scenario) I'm 👍 on removing the bundled nix. It's confusing because the nix version may not line up with your profile's nix version (and you really have very little other way to investigate what is going on without digging into the source, which is very unfortunate) and it is unnecessary because we no longer need a bleeding-edge nix for the commands we run so just about any version available will do. |
Happy to contribute this change if we can make a final decision. It seems the only disagreement is on whether or not to include a fallback nix package? I still think it's unnecessary. I'd rather see |
I just got bit by it twice, once using nix-direnv on NixOs via home-manager module which doesn't implement the same workaround as the nixos modules (as reported here). And another time helping my work colleague install nix-direnv on MacOS (we use nix v2.21 which doesn't suffer from the dot-in-path problem, while nix-direnv invoked whatever is the current default on unstable which still rejects dotted paths). How about offer 2 packages: one with bundled nix (for people who need it) and one without? |
We need to fixup the packaging than by excluding
and than do a |
Re: NixOS/nixpkgs#270741
The nix-direnv derivation wraps
direnvrc
by prepending the file withNIX_BIN_PREFIX=${pkgs.nix}
.As a result:
config.nix.package
, instead opting for the hardcodedpkgs.nix
In my opinion it doesn't make sense to bundle nix with nix-direnv. I think it's reasonable to expect nix to be in
PATH
on any system where people would actually want to use nix-direnv.The text was updated successfully, but these errors were encountered: