2

I wanted to try chaging channels. I did.

nix-channel --add .../nixos-unstable nix-channel --remove .../nixos-20.09 nix-channel --update 

It worked, it created a link and I could run:

nixos-rebuild switch 

However, my i3 stopped working correctly so I wanted to turn back to 20.09:

nix-channel --add .../nixos-20.09 nix-channel --remove .../nixos-unstable nix-channel --update 

But now it does not recreate that link and when run

nixos-rebuild switch 

it fails with

warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:13 building Nix... 

I have searched and tried a few solutions that worked for others like rebooting, running t with sudo -i but nothing worked so far. How do I recreate that link ?

1 Answer 1

2

Ok I found a way: I added the channel with a different name, instead of default nixos-10.09 just nixos

nix-channel --add ..../nixos-20.09 nixos nix-channel --remove nixos-20.09 nix-channel --update 

and lo and behold the link was created and all works again!

Sign up to request clarification or add additional context in comments.

1 Comment

The error seems to indicate that you had no nixos channel present. Perhaps it got removed somehow. So yes adding a channel named nixos would fix this.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.