Initial release | June 15, 2003 |
---|---|
Stable release | 2.19.2[1]
/ November 29, 2023 |
Repository | |
Written in | C++ |
Platform | Linux, Unix-like |
Type | Package management |
License | LGPL |
Website | nixos |
Nix is a cross-platform package manager. It is built with the eponymous "Nix" programming language and employs a model in which software packages are each installed into unique directories. These directory names correspond to cryptographic hashes of the contents of each package. A package's hash takes into account all of its dependencies. This solves the potential issue of installing many packages with differing versions of same shared library dependencies, and is claimed to eliminate so-called dependency hell,[2] As a result, this package management model advertises more reliable, reproducible, and portable packages.[3][4]
Packages are defined through files containing statements in the Nix language, described as:
The Nix language is designed for conveniently creating and composing derivations – precise descriptions of how contents of existing files are used to derive new files. It is a domain-specific, purely functional, lazily evaluated, dynamically typed programming language.[5]
Dependencies are tracked directly in this language through an intermediate format called "derivations". A Nix environment keeps track of references automatically, which allows unused packages to be garbage collected when no other package depends on them. At the cost of greater storage requirements, all upgrades in Nix are guaranteed to be both atomic and capable of efficient rollback. This also enables multiple users to safely install software on the same system without administrator privileges.
Nix has full support for Linux and macOS and can safely be installed side by side with an existing package manager.
Nix is used for software packaging and distribution in CERN's LHCb experiment.[6]
Main article: NixOS |
NixOS[7] is a Linux distribution using Nix for managing software in the system, including the Linux kernel.[8]
Nixpkgs is the package repository built upon the Nix package manager. According to Repology, as of March 2023 it contains more than 80,000 packages[9] and has a higher number of up-to-date packages than any other package repository.[10] Architectures supported by Nixpkgs are x86_64-linux, aarch64-linux, x86_64-darwin and aarch64-darwin. Packages for these architectures are regularly built, using a continuous integration service called Hydra,[11] and the results of these builds are uploaded to a public binary cache.[12] When Nix installs a package, it checks this cache and downloads the binary package to avoid building it locally.
Nixpkgs is developed in a single git repository on GitHub.[13] Beside packages, it also contains the source code for NixOS.