NixOS is a Linux distribution built around the Nix package manager, taking its reproducible-build principles to their logical conclusion: the entire operating system is described by a single declarative configuration file, and every state of the system (packages installed, services running, kernel version) is reproducible from that configuration. Rolling back to a previous system state is as easy as selecting an older generation at the bootloader.
NixOS makes several radical choices:
- Packages live in
/nix/store/<hash>-name-version/, never in/usr/binor/usr/lib. Binaries are symlinked into user profiles or service environments. - System configuration lives in
/etc/nixos/configuration.nixas a single declarative file in the Nix expression language. nixos-rebuild switchapplies changes atomically; failures roll back automatically.- Multiple versions of the same package coexist without conflict.
# /etc/nixos/configuration.nix excerpt
{ config, pkgs, ... }: {
environment.systemPackages = with pkgs; [ vim git htop ];
services.nginx.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
}
The payoff is reproducibility: if your Nix configuration builds on one machine, it builds the same way on another. The cost is a steep learning curve—Nix's language and mental model are genuinely different. NixOS attracts users who value reproducibility highly: research computing, immutable infrastructure, developer environments.
Related terms: nix, reproducible, Distribution
Discussed in:
- Chapter 20: The Linux Ecosystem — The Major Distribution Families
Also defined in: Textbook of Linux