How to tell what is the active release?

Pretty new to NixOS here. I just upgraded one machine from 21.05 to 21.11. I was surprised to find that /etc/os-release still says 21.05. Did I miss something in the upgrade? And if I changed the channel for nixos to 21.11, but have not yet run the --upgrade, how would I determine the actual state of the system (still 21.05, I presume).

I read /etc/os-release as root. The manual says " Channels are set per user. This means that running nix-channel --add as a non root user (or without sudo) will not affect configuration in /etc/nixos/configuration.nix". Does that mean that different users with different channel settings might see different versions of /etc/os-release?

Well, I think I did “boot” instead of “switch” on one machine, so it upgraded after the reboot. Sigh.

Is there an easy way to see the actual active release, independent of /etc/os-release and nix-channel? Or is that just lost in the hash of symlinks?

Your active one is to be found in os-release.

That will always reflect the version your currently active session is in.

And that file is generated globally. If a user by itself uses a different channel, that doesn’t change the version the system is one, but only the source of “packages” the user installs from.

1 Like