Hi, I was trying to set up home-manager which I first installed as package declared in my configuration.nix. But after writing and rolling out my first home-manager configs, I now get following error trying to execute for example “home-manager switch”:
error: file ‘home-manager/home-manager/home-manager.nix’ was not found in the Nix search path (add it using $NIX_PATH or -I)
Now I didn’t want to just add the path with a command, because it wouldn’t be declarative and also because I didn’t know where that path was and trying to set my system up again would lead to the same error. Looking for a solution I looked into what the NIX_PATH is and using Nix-Pills found out “~.nix-defexpr/channels” was default part of it. A couple directories down in “~.nix-defexpr/channels/release-24.11.tar.gz/home-manager/” there is a home-manager.nix file.
Now I’m not sure what to do and where exactly things broke, I tried a few other things such as adding the home-manager nix channel and installing again using “nix-shell ‘’ -A install” but it didn’t work. I couldn’t find direct help for my problem.
Can anyone tell me how things should be?
I want to have home-manager set up standalone, e.g. without root.
I’m pretty new to NixOS and Desktop Linux and I never write in forums.
Could you share the contents of your home.nix
?
Ofc,
here the parts:
edit: I removed it again
Did you run nix-channel --update
recently?
Also please share the output of nix-channel --list
.
Yeah, I did run that.
nix-channel --list:
release-24.11.tar.gz https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz
Okay, so that’s the issue, the name is wrong.
Delete that channel (nix-channel --remove release-24.11.tar.gz
), then add the HM channel as specified in the HM manual:
https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone
nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager nix-channel --update
Thank you,
idk how I messed that up haha.