-
-
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
nix-direnv cannot find nixpkgs with nix-2.4 #119
Comments
It seems that If you use channels make sure that they are included in your $NIX_PATH environment variable: $ ls -la $HOME/.nix-defexpr/channels
nixpkgs
$ export NIX_PATH=$HOME/.nix-defexpr/channels Sorry but this issue is not related to nix-direnv and nix-direnv cannot magically fix your setup. So I am closing this. |
it seems that nix 2.4 is using default values when NIX_PATH is unset (NixOS/nix@ec9dd9a), and that because of this the default profile setup doesn't set NIX_PATH anymore so the cause of this issue is that nix-direnv depends on and uses nix-2.3.16 instead of the nix it's installed with, and that version fails to deal with the setup provided by nix 2.4 (and generates warnings about newer config settings like |
We upgraded nix-direnv to point to nix-2.4 now by default quite recently: NixOS/nixpkgs#145236 |
perfect, then i'll just wait until that gets released and hits the channel. thank you! |
I have a
.envrc
containinguse nix
, and ashell.nix
containingwith import <nixpkgs> {}; stdenv.mkDerivation { name = "name"; nativeBuildInputs = [ (leiningen.override { jdk = jdk11; }) ]; }
This works fine with nix 2.3, but after upgrading to
nix (Nix) 2.4pre-rc1
, I get the following when Icd
into the directory:error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
However,
nix-shell
still works, and if I use direnv without nix-direnv, that also works.I'm on macos, and am using home-manager (
programs.direnv.nix-direnv.enable = true;
), if that's relevant.The full output after using
cd
is as follows:The text was updated successfully, but these errors were encountered: