I am confused by the current state of my channel subscription on NixOS. It seems that I have a per-user subscription to nixos-17.03 and nixos-17.09:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.13, NixOS, 18.09.1853.c2950341d03 (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.1.3`
 - channels(alexey): `"nixos-17.03-17.03.1949.78e9665b48f, nixos-17.09-17.09.3238.e984f9e48e1"`
 - channels(root): `"nixos-18.09.1853.c2950341d03"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
$ tree /nix/var/nix/profiles/per-user/alexey/channels
├── binary-caches
│   ├── nixos-17.03 -> /nix/store/kzd027j27bifzi82339isf6rzir2g1hq-nixos-17.03-17.03.1949.78e9665b48f/binary-caches/nixos-17.03
│   └── nixos-17.09 -> /nix/store/m7qgsz2wy9rgc7dpzsacybc9rw79pxxh-nixos-17.09-17.09.3238.e984f9e48e1/binary-caches/nixos-17.09
├── manifest.nix -> /nix/store/913gblkfnvb0sz130wm59s82jxwkp3b1-env-manifest.nix
├── nixos-17.03 -> /nix/store/kzd027j27bifzi82339isf6rzir2g1hq-nixos-17.03-17.03.1949.78e9665b48f/nixos-17.03
└── nixos-17.09 -> /nix/store/m7qgsz2wy9rgc7dpzsacybc9rw79pxxh-nixos-17.09-17.09.3238.e984f9e48e1/nixos-17.09

However, they are not shown with nix-channel --list, and I cannot remove them with nix-channel --remove:

$ nix-channel --list
$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-18.09

Is something broken on my system, or what could be the explanation? How can I remove those per-user channels?

  • I've opened an issue about this for Nix. – Alexey Feb 10 at 13:34
  • Why is channel listing only shown when sudo? – typelogic Sep 14 at 4:53

Guesstimate: have you ran nix-channel --update since dropping them? (not tested, etc.) You've dropped all channels from your user, according to the output.

  • I've just tried it, without and with sudo (by the way, not sure if sudo is needed), and also i did nixos-rebuild switch --upgrade, but they still show up. – Alexey Jan 8 at 19:20
  • With sudo you operate on root's channel list, without it you operate on the user's channel list. It might be bug that removing names doesn't really work. I certainly did replace channel URL while keeping the name and that works but it's something else. – Vladimír Čunát Jan 9 at 12:04
  • 1
    Could it be related to this open issue about "Channel names with . or -"? – Alexey Jan 9 at 13:07
  • Could you suggest by any chance how to "manually" remove them without breaking anything? – Alexey Jan 14 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.