Importing a channel is broken now?

I used to be able to import a channel in my configuration.nix, so I could get unstable packages while my nixos is on stable, or vice versa. Is that broken now? Or maybe they are phasing channels out?

on my stable machine:

[bburdette@HOSS:~]$ sudo nix-channel --list
[sudo] password for bburdette:
nixos https://nixos.org/channels/nixos-22.11
nixos-22.11 https://nixos.org/channels/nixos-22.11
nixos-unstable https://nixos.org/channels/nixos-unstable

[bburdette@HOSS:~]$ sudo nix repl
Welcome to Nix 2.11.1. Type :? for help.

nix-repl> <nixos-22.11>
/nix/var/nix/profiles/per-user/root/channels/nixos-22.11

on a machine running unstable:

bburdette@BB-5520:~$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-unstable
nixos-22-11 https://nixos.org/channels/nixos-22.11
nixosstable https://nixos.org/channels/nixos-22.11
bburdette@BB-5520:~$ sudo nix repl
Welcome to Nix 2.14.1. Type :? for help.

nix-repl> <nixos-22-11>
error:
       … while calling the 'findFile' builtin

         at «string»:1:1:

            1| <nixos-22-11>
             | ^

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

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

nix-repl>

You probably changed NIX_PATH somehow. The default still includes root’s channels.

interesting… for root it looks the same to me, except on my laptop its different in my user account.

on my machine with 22.11:

[bburdette@HOSS:~]$ echo $NIX_PATH
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
[bburdette@HOSS:~]$ su
Password:

[root@HOSS:/home/bburdette]# echo $NIX_PATH
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels

And on my hapless laptop:

[bburdette@BB-5520:~]$ echo $NIX_PATH
home/bburdette/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
bburdette@BB-5520:~$ su
Password:

[root@BB-5520:/home/bburdette]# echo $NIX_PATH
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels

TLDR: same paths in root, but in user there’s the .nix-defexpr bit on the laptop.