Nix-shell -p running an old version?

I’m trying to run a package (yarn-berry) that I find via
If I look at the source there, it reports version 4.0.1.

On my mac, when I run nix-shell -p yarn-berry I get version 4.0.1

But on linux, no matter what I do, I always get 3.2.0

This is what I tried so far:

> nix-collect-garbage -d
> nix-channel --update
unpacking channels...
>nix-channel --list
> nix-shell -p yarn-berry

In this new shell:

[nix-shell:~]$ type yarn
yarn is /nix/store/w5kij9d9hnflmch1ic7zkh2gmi4dnfgd-yarn-berry/bin/yarn

[nix-shell:~]$ yarn --version

Why do I get version 3.2.0??

sudo nix-channel --list

returns nothing.
without sudo: nixpkgs-unstable

What does

nix-instantiate --eval -E '(import <nixpkgs> { }).lib.trivial.revisionWithDefault ""'


> nix-instantiate --eval -E '(import <nixpkgs> { }).lib.trivial.revisionWithDefault ""'

What’s the content of


Also just noticed your channel is called nixpkgs-unstable. nix-shell will use the channel called nixpkgs. If you had a nixpkgs channel before, it might still be around. Check /nix/var/nix/profiles/per-user/$USER/channels/ and /nix/var/nix/profiles/per-user/root/channels/.

➜ pwd
➜ ll
lrwxrwxrwx - root  1 Jan  1970 manifest.nix -> /nix/store/k85k972pjsc96yc6bgd7326z6wqfwc5k-env-manifest.nix
lrwxrwxrwx - root  1 Jan  1970 nixpkgs-unstable -> /nix/store/qxk3dqalh4l234sncrrdrjr3mdzlddsb-nixpkgs-unstable/nixpkgs-unstable

root is empty.

➜ pwd
➜ cat .git-revision

as you can see /nix/var/nix/profiles/per-user/$USER/channels/nixpkgs/.git-revision does not exist

Again, check /nix/var/nix/profiles/per-user/root/channels/.

the root folder is completely empty

You’re going to have to walk your $NIX_PATH and look for nixpkgs sub-directories. Nix chooses the first one I believe.