Assuming you’re not executing this in a root shell, that will evaluate the command as your user, which has a separate set of channels. Most likely your root user is using the stable channel.
What does doas nix-channel --list give you (and nix-channel --list just so we get an idea of your user channels as well)?
Erm… This thread is making me doubt my understanding of nix…
Shouldn’t you be pulling packages from unstable, i.e. 23.05, then?
I’m mildly confused, does the running system being 22.11 somehow modify the channel being used? That’s not how channels work at all aiui, but I’ve not touched them in a while…
Or are you just in fact not actually using the unstable channel, @NapoleonWils0n?
For what it’s worth, you can mix and match a stable and unstable packages, you just need to add a second channel and import the package from it instead of <nixpkgs>. So it’s not really a version “requirement”.