How to Update NixOS
I recently wrote a post called How to Setup NixOS on a Raspberry Pi and haven't touched the system I setup there in a little while. Now I booted it back up and found that there has been a new release of NixOS in the meantime.
So here is a quick how-to on updating NixOS:
nixoschannel with the newer version
nix-channel --add https://nixos.org/channels/nixos-21.05 nixos
Update the channel
nix-channel --update nixos
Rebuild the system
nixos-rebuild --upgrade switch
If anything goes wrong, choose the previous version of the system using the bootloader.