To upgrade between NixOS versions, we need to login or become root and add the channel for the new version.
Important: Channels are set per user. That means that running nix-channel --add
as a non root user (or without sudo) will not affect configuration in /etc/nixos/configuration.nix
. So, to upgrade, you need to login as root or become root with sudo
.
nix-channel --list | grep nixos
nix-channel --add https://channels.nixos.org/nixos-23.11 nixos && \
nixos-rebuild switch --upgrade
Then, reboot the machine. After the reboot, check again the NixOS channel version:
nix-channel --list | grep nixos
It must be the new one.