NixOS Introductory Article

I’ve written a bit about Nix in the past. Nix’ author (and colleague) Eelco Dolstra now has published a great article on InfoQ about Nix and NixOS. Very clearly indicates why Nix is different — and if you ask me — clearly the right way to do package/configuration management:

NixOS is a Linux distribution with a fully declarative approach to configuration management designed to overcome these problems. It builds on Nix, a package manager that builds and stores packages in a way that does away with the “destructive” model of package managers like RPM or Apt. NixOS extends this approach to the configuration management of an entire Linux system. This gives many advantages, most importantly:

  • Atomic upgrades: during a package or system upgrade, the system remains in a consistent state. If you run a program at any point in time, you’ll get the old or the new version, but not something in between. Similarly, if the system crashes half-way through an upgrade, it will still work. Put in another way, upgrades are transactional.
  • Rollbacks: upgrades don’t overwrite the old packages and configuration files, so if a new configuration doesn’t work, you can revert to the previous state. This also makes testing configuration changes less scary.
  • Reproducibility: Nix tries very hard to ensure that a package build always produces the same result. This property extends to NixOS: deploying a NixOS configuration on another machine will yield the same result, regardless of whether this machine is a clean install or already had a previous configuration.

If you never got the value of Nix from any of my posts, give this article a try. Actually, even if you did: read this article.