Nixpkgs: The Package Collection That Defines NixOS
Nix Packages collection & NixOS. Nixpkgs describes how to build tens of thousands of pieces of software and implements a Linux distribution.
At a glance
- What is it?
- Nixpkgs is the central repository for Nix and NixOS, containing over 140,000 package definitions. This review examines its architecture, usage, and limitations for engineers considering adoption.
- Who is it for?
- Adopt Nixpkgs if you are already using Nix or NixOS and need a reproducible, purely functional package set. Do not adopt it if you want a traditional package manager with binary-only distribution or if you are unwilling to learn the Nix language.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Nix, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The Problem Nixpkgs Solves
Traditional package managers like apt or yum install software into a shared system state, where dependencies can conflict and upgrades are not easily reversible. Nixpkgs addresses this by describing how to build software in a purely functional way. Each package is built from a Nix expression that specifies its inputs, and the build result is stored in a content-addressed store. This means that the same expression always produces the same result, and multiple versions of a package can coexist without conflict. Nixpkgs is the collection of these expressions, and it also implements NixOS, a Linux distribution built on this model. The intended audience is engineers who need reproducible builds, atomic upgrades, and the ability to roll back changes. It is also for system administrators who want to manage entire system configurations declaratively.
How Nixpkgs Works: Expressions, Store, and Hydra
The repository contains tens of thousands of Nix expressions, each defining how to build a piece of software. These expressions are written in the Nix language, which is a pure functional language. The build process is deterministic: given the same inputs, the same output is produced. Nixpkgs also includes NixOS modules, which are Nix expressions that describe system configuration, such as services, users, and networking. The continuous integration system, Hydra, builds and tests the packages. Successful builds are published to a binary cache at cache.nixos.org, so users do not have to compile everything from source. The Nix package manager uses this cache to download pre-built binaries when available. The repository is the single source of truth for both package recipes and the NixOS distribution. The README states that Nixpkgs describes how to build tens of thousands of pieces of software and implements a Linux distribution.
Getting Started: Installing and Using Nixpkgs
To use Nixpkgs, you first install the Nix package manager, which is available from nixos.org. The README links to the Nix Package Manager Manual for instructions on writing Nix expressions and using the command line tools. Once Nix is installed, you can install packages from Nixpkgs using the nix-env command, or you can define a shell environment with nix-shell. For NixOS, you install the distribution and then edit a configuration file, typically /etc/nixos/configuration.nix. This file uses Nix expressions to declare the system configuration, and you apply changes with the nixos-rebuild command. The NixOS Manual provides detailed instructions. The README also mentions Nix channels, which are used to distribute Nixpkgs expressions. You can subscribe to a channel like nixpkgs-unstable or nixos-26.05 to get updates. The exact commands are not detailed in the README, but the manuals are the primary reference.
Limitations and Failure Modes
One limitation is the learning curve. The Nix language is a functional language, which is unfamiliar to many developers. Writing custom package expressions requires understanding the language and the Nixpkgs conventions. Another limitation is that the binary cache may not have pre-built binaries for your specific platform or configuration, especially if you are using a less common architecture or if you have custom options. In that case, you must build from source, which can be slow. The README notes that Nixpkgs is among the most active projects on GitHub, with thousands of open issues and pull requests. This activity can be overwhelming for newcomers and may slow down pull request reviews. A failure mode is that a package may be broken in the unstable channel, but the release channels are more stable. If you need a package that is not in Nixpkgs, you may need to write your own expression, which is a significant effort.
Alternatives: Guix and Traditional Package Managers
The most direct alternative is GNU Guix, which also uses a purely functional package management model. Guix is based on the Nix store concept but uses the Guile Scheme language for expressions. The key difference is the language: Nixpkgs uses Nix, while Guix uses Scheme. This affects how you write package definitions and system configurations. If you prefer Lisp-like syntax, Guix may be more approachable. Traditional package managers like apt or dnf are alternatives but with a different approach: they manage a shared system state and do not provide the same reproducibility or rollback guarantees. They are easier to learn and have a larger set of pre-built binaries for common platforms, but they lack the functional purity that Nixpkgs offers. The choice depends on whether you value reproducibility over simplicity.
Maintenance and Upgrade Cost
Nixpkgs is a continuously evolving repository. The README mentions continuous builds for the unstable/master branch and for release branches like release-26.05. Upgrading NixOS involves changing the channel or the configuration file and running nixos-rebuild switch. The cost is that you need to track changes in Nixpkgs, especially if you maintain custom expressions. The repository has a formal RFC process for substantial changes, which adds governance but also overhead. The license is MIT, but it applies only to the repository files, not to the packages built by Nixpkgs. Packages retain their own licenses, and patches included in Nixpkgs may be derivative works with their own licensing. This means you must check the license of each package you use, not just the repository license.
Editorial conclusion
Adopt Nixpkgs if you are already using Nix or NixOS and need a reproducible, purely functional package set. Do not adopt it if you want a traditional package manager with binary-only distribution or if you are unwilling to learn the Nix language. Before adopting, verify that the packages you need are present and that your team can handle the learning curve and the large, active but sometimes chaotic contribution process. The repository is the foundation of NixOS, so its maintenance and upgrade path are tied to the NixOS release cycle, with continuous builds from Hydra.
Community notes