Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I upgrade my system to nixos-unstable?

Tags:

How do I make sure that all packages I install on my system nixos installation (i.e. packages listed in /etc/nixos/configuration.nix, which I install using sudo nixos-rebuild switch) are using the latest (unstable) version of nixos/nixpkgs?

like image 589
sid-kap Avatar asked Dec 19 '16 20:12

sid-kap


People also ask

Is NixOS lightweight?

Mainly because Nix is intended to be lightweight, easy to learn and portable (zero dependencies).

Is NixOS rolling?

The official channels New stable channels are released every six months. Unstable channels ( nixos-unstable , nixpkgs-unstable ) correspond to the main development branch (master) of Nixpkgs, delivering the latest tested updates on a rolling basis.


2 Answers

As explained in the manual's section on upgrading, if you issue the following command as root:

nix-channel --list 

you will most likely see something like the following (if you were following the 16.09 branch for instance):

nixos https://nixos.org/channels/nixos-16.09 

By issuing the following command (still as root):

nix-channel --add https://nixos.org/channels/nixos-unstable nixos 

you will remove the 16.09 channel and replace it with nixos-unstable.

Now this is not enough yet. To really update your system, you need one last command:

nixos-rebuild switch --upgrade 

which is going to rebuild your system with your current configuration and updated packages from the channel you switched to.

like image 184
Zimm i48 Avatar answered Oct 02 '22 22:10

Zimm i48


Run the following commands:

sudo nix-channel --add https://nixos.org/channels/nixos-unstable sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable 

Note that the sudo is required: if you don't use sudo, it will only affect user-level packages (i.e. things you install using nix-env -i), not system-level packages.

like image 29
sid-kap Avatar answered Oct 02 '22 23:10

sid-kap