Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 26, 2026·3 min de lecture

Nixpkgs — The Largest Reproducible Package Collection

A community-driven repository of over 100,000 packages for the Nix package manager, providing reproducible builds and declarative system configuration across Linux and macOS.

Prêt pour agents

Installation avec revue préalable

Cet actif nécessite une revue. Le prompt copié demande un dry-run, affiche les écritures, puis continue seulement après confirmation.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Nixpkgs Overview
Commande avec revue préalable
npx -y tokrepo@latest install 74276a46-58ba-11f1-9bc6-00163e2b0d79 --target codex

Dry-run d'abord, confirmez les écritures, puis lancez cette commande.

Introduction

Nixpkgs is the package collection for the Nix package manager, maintained by thousands of contributors worldwide. It provides a single repository of package definitions (called derivations) that produce bit-for-bit reproducible builds. Every package build is isolated in a sandbox, ensuring that dependency graphs are explicit and that builds work the same way on any machine.

What Nixpkgs Does

  • Defines over 100,000 packages in a single monorepo using the Nix expression language
  • Produces reproducible builds by pinning every dependency down to the compiler and libc version
  • Supports Linux (x86_64, aarch64) and macOS (Intel and Apple Silicon) from one source tree
  • Provides NixOS modules for declarative system configuration (services, users, networking)
  • Enables atomic upgrades and rollbacks so a bad update never leaves your system broken

Architecture Overview

Nixpkgs is a large Git repository of Nix expressions. Each package is a function that declares its build inputs, build script, and metadata. The Nix evaluator reads these expressions, computes a hash of all inputs (source tarballs, compilers, flags), and stores the result under /nix/store/<hash>-<name>. Because the path encodes the full dependency tree, multiple versions of the same library coexist without conflict. Hydra, the Nix CI system, pre-builds binary caches so most users download substitutes instead of compiling from source.

Self-Hosting & Configuration

  • Clone the repo: git clone https://github.com/NixOS/nixpkgs.git
  • Pin a specific commit in your project with flake.lock or niv for reproducibility
  • Override packages using overlays to patch or change build flags
  • Set up a private binary cache with nix-serve or Cachix to share builds across your team
  • Use nixos-rebuild switch to apply system-level changes on NixOS machines

Key Features

  • Bit-for-bit reproducible builds backed by content-addressed store paths
  • Atomic upgrades and rollbacks via symlink switching with no partial installs
  • Cross-compilation support for embedded and foreign architectures out of the box
  • Flakes provide hermetic project-level dependency management with a lock file
  • One of the fastest-moving open-source repos with thousands of package updates per week

Comparison with Similar Tools

  • Homebrew — user-friendly on macOS but not reproducible; Nixpkgs guarantees identical outputs across machines
  • apt / dnf — distribution-specific; Nixpkgs works across Linux distros and macOS from one source
  • Guix — similar concept using Guile Scheme; Nixpkgs has a much larger package set and community
  • Docker — isolates at the container level; Nix isolates at the package level, producing smaller closures
  • Conda — focused on Python/data-science; Nixpkgs covers the full OS stack including kernels and services

FAQ

Q: Do I need to use NixOS to benefit from Nixpkgs? A: No. You can install the Nix package manager on any Linux distro or macOS and use Nixpkgs packages alongside your system package manager.

Q: How do I update all my packages? A: Run nix flake update (if using flakes) or nix-channel --update && nix-env -u to pull the latest package definitions and upgrade.

Q: Is Nixpkgs suitable for production servers? A: Yes. NixOS is used in production by companies like Determinate Systems and Tweag for its reproducibility and rollback guarantees.

Q: How do I contribute a new package? A: Fork the nixpkgs repository, add your package derivation under the appropriate directory, and open a pull request. The Nixpkgs manual documents the conventions.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires