Gibberish nix channel being added to my list, preventing update

After attempting to update my system today (unstable channel) and failing due to package build failure and daemon start failure, every time I run nixos-rebuild switch as root, I get a new nix channel added with a gibberish name and no link.

nix-channel --list 
"s "s
nixos "https://nixos.org/channels/nixos-unstable

"s "s is the weird channel in question. After that, nixos-rebuild switch --upgrade does not work because of it, throwing this error:

error: reading symbolic link '/nix/var/nix/profiles/per-user/root/channels/"s': No such file or directory

I attempt to remove it with nix-channel --remove "\"s \"s", but it throws the error:

warning: selector '"s "s' matched no installed derivations

I also just noticed the link of the nixos channel is also wrong, starting with a "

I removed the nixos channel and added it again, now it’s correct and the gibberish channel is also gone. I ran nix-channel --update and everything seemed to be fine, but the same issue happened again by itself:

" "
nixos "https://nixos.org/channels/nixos-unstable

Even after fixing the nixos channel link, the gibberish channel is still there. I cannot update my channels or my system.

When I attempt nixos-rebuild switch as root:

warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error:
       … <borked>

         at «none»:0: (source not available)

       … while calling the 'import' builtin

         at «string»:1:6:

            1| with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild
             |      ^

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
building Nix...
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 «none»:0: (source not available)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos/modules/installer/tools/nix-fallback-paths.nix' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
/tmp/nixos-rebuild.LGqjqm/nix
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
building the system configuration...
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 «none»:0: (source not available)

It seems the fix hasn’t exactly worked, and so a new pull request is open nixos/nix-channnel: fix setting up the default channel again by nikstur · Pull Request #264831 · NixOS/nixpkgs · GitHub.

I’ll wait for it to be merged and arrive to unstable. Honestly once NixOS Tapir comes out I’ll just stick to the stable branch and only grab a small selection of packages from unstable.

This should be fixed now. See this tracking issue: "Invalid URL" when updating channels on current nixos-unstable · Issue #264852 · NixOS/nixpkgs · GitHub

1 Like