TechnologyLinux distribution

NixOS

Also known as: Nix

Linux distribution built on the Nix package manager that describes the whole system in declarative configuration and supports atomic upgrades and rollbacks.

NixOS is a linux distribution in which the operating system, its packages and its services are defined in configuration files written in the Nix language. Instead of changing the system step by step with commands, the user edits the configuration and asks NixOS to build a matching system. It is built on Nix, a package manager that grew out of Eelco Dolstra's doctoral research at Utrecht University in the early 2000s on purely functional software deployment.

Nix treats package builds somewhat like pure functions in functional programming: each package is built from explicitly declared inputs and stored in its own directory, named with a cryptographic hash of those inputs. Different versions of a library can therefore coexist without conflict, and an upgrade creates a fresh system generation rather than overwriting the old one. If an upgrade causes problems, the previous generation can be selected at boot. The Nixpkgs collection, maintained by a large contributor community, is one of the largest software repositories of any distribution.

The declarative model makes NixOS attractive for infrastructure as code, reproducible development environments and fleets of machines that must stay identical. It also supports work on reproducible builds, in which independent parties rebuild software and verify that the results match. The main costs are a steep learning curve, an unusual file layout that some prebuilt software does not expect, and documentation that users often describe as uneven. Nix can also be used on other Linux distributions and on macOS without NixOS itself.

Key points

  • NixOS defines an entire system, including packages and services, in declarative Nix configuration files.
  • Every upgrade creates a separate system generation, so earlier configurations can be restored at boot.
  • Packages live in hash-named directories, allowing multiple versions to coexist without conflicts.
  • The Nix package manager also runs on other Linux distributions and on macOS.

Related entries

Glossary term

Practice of defining and provisioning servers, networks and other infrastructure through machine-readable files rather than manual configuration.

Glossary term

Reproducible Builds

FOSSCybersecurity

Practice of making software builds deterministic so anyone can rebuild published binaries from source and get bit-for-bit identical results.

Glossary term

Programming paradigm that builds software by composing pure functions, treating computation as evaluating expressions rather than changing state.

Glossary term

Package Manager

ProgrammingFOSS

Tool that automates installing, upgrading, configuring and removing software packages and their dependencies from shared repositories.

Glossary term

Approach in which servers and other components are never modified after deployment; changes are made by replacing them with freshly built versions.

Glossary term

Discipline and tooling for establishing and maintaining a known, consistent state for systems, software and their settings over time.

Glossary term

Operating system assembled from the Linux kernel, system software, applications, a package manager and an installer, maintained as one product.

Technology

Independent rolling-release Linux distribution built around simplicity, user control and a minimal base system that users assemble for their own needs.