Upgrade NixOS versions
Overview
This guide provides general guidance on upgrading between NixOS versions
Check which version you're currently running
cat /etc/lsb_release
Get list of channels
This provides the URL used to download packages for nixos release
nix-channel --list | grep nixos
Add / Replace Software Channel
To get on the latest version, you need to update the nixos
channel to the latest version.
You can find a list of versions in this repository.
For example, if you wanted to upgrade to the latest 24.05 version, you'd use the following command:
nix-channel --add https://channels.nixos.org/nixos-24.05 nixos
The general format is: nix-channel --add <CHANNEL_URL> nixos
Rebuild your system
Once you've configured the channel for the latest version, switch to it just like you would when upgading sofware packages.
nixos-rebuild switch --upgrade
After the operation completes, you'll want to check which version is running as mentioned in previous instructions.