Skip to content
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

file 'home-manager' was not found in the Nix search path #487

Closed
ghost opened this issue Dec 7, 2018 · 9 comments
Closed

file 'home-manager' was not found in the Nix search path #487

ghost opened this issue Dec 7, 2018 · 9 comments

Comments

@ghost
Copy link

ghost commented Dec 7, 2018

$ nix-shell '<home-manager>' -A install
error: file 'home-manager' was not found in the Nix search path (add it using $NIX_PATH or -I)

Hi, I receive the above when trying to install home manager.

@uvNikita
Copy link
Collaborator

uvNikita commented Dec 7, 2018

Did you remember to run:

$ nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update

Because it seems that nix can't find a home-manager channel.

@ghost
Copy link
Author

ghost commented Dec 7, 2018

Thanks for the quick reply. I have already home-manager channel added:

$ nix-channel --list
home-manager https://github.com/rycee/home-manager/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

@rycee
Copy link
Member

rycee commented Dec 7, 2018

@mehandes Does your NIX_PATH contain ~/.nix-defexpr/channels? Running echo $NIX_PATH gives me

$ echo $NIX_PATH 
/home/rycee/.nix-defexpr/channels:nixpkgs=/home/rycee/devel/nixpkgs-18.09:nixos-config=/etc/nixos/configuration.nix

I did notice that if you don't have a ~/.nix-defexpr/channels directory before doing nix-channel --add then it is necessary to log out and back in for it to show up in NIX_PATH.

@ghost
Copy link
Author

ghost commented Dec 7, 2018

@rycee Yes, it does

$ echo $NIX_PATH
nixpkgs=/home/mc/.nix-defexpr/channels/nixpkgs
$ nix-shell '<home-manager>' -A install
error: file 'home-manager' was not found in the Nix search path (add it using $NIX_PATH or -I)

@rycee
Copy link
Member

rycee commented Dec 7, 2018 via email

@ghost
Copy link
Author

ghost commented Dec 7, 2018

Yes, I relogged, rebooted and tried even on VPS. I am using Linux 4.15.0-42-generic #45-Ubuntu SMP.

Thanks for the suggestion - I tried

NIX_PATH=/home/mc/.nix-defexpr/channels:nixpkgs=/home/mc/.nix-defexpr/channels/nixpkgs nix-shell '<home-manager>' -A install

and it worked, but I don't know why and if I should change the NIX_PATH permanently.

@willbush
Copy link

willbush commented Dec 23, 2018

it is necessary to log out and back in for it to show up in NIX_PATH.

I had a similar issue when following the install instructions in the readme. However, logging out and back in added ~/.nix-defexpr/channels to the nix path and it now works.

@kerrnelPanic
Copy link

Hmm, from what I can tell it is actually missing the entry I was looking for. I believe it would work if it was set to /home/mc/.nix-defexpr/channels:nixpkgs=/home/mc/.nix-defexpr/channels/nixpkgs Did you try a relog? Also are you using NixOS or a Nix installation on some other system?

On December 7, 2018 6:32:10 PM GMT+01:00, Matt @.***> wrote: @rycee Yes, it does $ echo $NIX_PATH nixpkgs=/home/mc/.nix-defexpr/channels/nixpkgs $ nix-shell '<home-manager>' -A install error: file 'home-manager' was not found in the Nix search path (add it using $NIX_PATH or -I) -- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: #487 (comment)
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

I faced that problem, too, relog, reboot didn't help. Executing the channel commands with elevated rights did help. I think the documentation is a bit imprecise here, having '$ command someOption', instead of '# command someOption' as examples, so it doesn't point out that you may need elevated rights.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/home-manager-command-wont-switch-twice-on-nixos/50344/1

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants