Nix and the move toward reproducible environments
Eelco Dolstra created Nix to ensure software reproducibility through isolated builds and a purely functional language. The nixpkgs repository provides over 122,000 up-to-date packages, allowing developers to manage complex dependencies and roll back versions easily.
How Nix manages software isolation
Nix uses a unique approach to package management and system configuration. It runs on Linux and macOS next to the package manager you already have. Eelco Dolstra created Nix to address software management needs. Nix builds packages in isolation from each other to ensure reproducibility. This isolation prevents undeclared dependencies from appearing in a build. If a package works on one machine, it will also work on another machine. The Nix language, which is declarative and purely functional, specifies the contents of new files. These package recipes use string interpolation and first-class file system paths to express dependencies. The Nix language is also lazily evaluated and dynamically typed. It includes indented strings and strings with context to express dependencies between file system data concisely.
Dependencies between files are automatically tracked and persisted in the Nix store. New files in the Nix store come from derivations. A derivation is a persistent data structure that specifies an executable, arguments, environment variables, and other files to be read from the Nix store. The executable runs in a sandbox that prohibits access to anything but the explicitly specified input files. It only allows writing to the designated output path. Nix preserves dependency information in output files by scanning for the distinctive hashes used for package directory names. Nix provides a way to install many packages with differing versions of shared libraries because its unique directory names allow for the isolation of files within the Nix store to prevent dependency hell. NixOS is a Linux distribution built around the Nix package manager and Nixpkgs. This distribution can describe a laptop or a fleet of servers in reversible and repeatable configuration.
Streamlining development for modern stacks
Nix makes it trivial to share development and build environments for projects, regardless of the programming languages and tools used. Modern web development often uses Node.js to manage dependencies and prepare projects for production. Developers using frameworks like React and Vue.js can use Nix to ensure their environments remain consistent. You probably won’t want to go back to a world without Nix if you work on complex software projects. Nix ensures that installing or upgrading one package cannot break other packages. Users can roll back to previous versions. This prevents a package from staying in an inconsistent state during an upgrade.
Because Nix uses automatic reference tracking, it ensures the integrity of packages when they move across machines. It also enables garbage collection of unused packages when no other package depends on them. Does the increased storage requirement for the Nix store outweigh the benefits of atomic upgrades? Users can install software on the same system without administrator privileges thanks to the unique directory names used in the system. Nix supports Linux, macOS, WSL, FreeBSD, and OpenBSD. It also supports 64-bit x86 and ARM CPU architectures.
The scale of the Nixpkgs repository
The Nix Packages collection, or nixpkgs, is the package repository for the Nix package manager. As of January 2025, nixpkgs contains more than 122,000 packages. It has a higher number of up-to-date packages than any other package repository. Nixpkgs is developed in a single Git repository on GitHub. It also contains the source code for NixOS.
The community builds packages for the repository using Hydra, a continuous integration service. Results from these builds go to a public binary cache. When Nix installs a package, it checks this cache and downloads the binary package to avoid building it locally. This avoids the need for local builds every time a user needs a package. However, Nix requires more storage space than traditional managers because it keeps multiple versions of packages to allow for easy rollbacks.
| Feature | Detail |
|---|---|
| Original author | Eelco Dolstra |
| Stable release | 2.35.4 |
| Programming language | Nix and C++ |
| Package count | >122,000 |
| Supported OS | Linux, Darwin, FreeBSD, OpenBSD |
| CPU Architectures | 64-bit x86, ARM |