Re:What Is Nix?
by kdtsh on Wednesday May 20, 2020 @05:21PM
(#23251941)
Nix is a package manager. NixOS is an OS which includes the Nix package manager. My understanding is that a feature of Nix is you can declare an OS (I.e. declare the collection of configurations and software etc for an OS) which Nix will process to provide you with an OS called NixOS.
[ Parent
| on HN ]
So it processes the config file (and thus all needed packages) one time or does it process it every time you boot?
Re:What Is Nix?
by heisenzombie on Wednesday May 20, 2020 @06:07PM
(#23252528)
You type
nixos-rebuild switch
and it builds you an entire OS and drops you into it. It also makes the new OS the default on startup.Because it's all purely declarative, your old OS is still there. If things go wrong then you can just pop back to it, either in the command line with:
nixos-rebuild switch --rollback
Or when you reboot, the previous 'generations' of your operating system show up in GRUB, so just choose an older one to boot.Thanksfor your comment.This is very interesting for my Raspberry Pi. The ability kit it out according to function is great.
Whenever you run `nixos-rebuild switch` a symlink is created for `/run/current-system` which is the current system. That's what is used on every boot until another change (you also have an option in boot loader to boot into prior versions (it is just a symlink))