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

Nix — Reproducible Package Manager and Build System

A purely functional package manager that ensures reproducible builds and atomic upgrades across Linux and macOS, powering NixOS and developer environments.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Nix
Commande CLI universelle
npx tokrepo install 197d54ef-48c0-11f1-9bc6-00163e2b0d79

Introduction

Nix is a purely functional package manager where each package is built in isolation from a precise description of its dependencies. This model guarantees reproducible builds, atomic upgrades and rollbacks, and the ability to run multiple versions of any package side by side without conflicts.

What Nix Does

  • Builds and installs packages in isolation under /nix/store with content-addressed paths
  • Provides atomic upgrades and instant rollbacks for system and user profiles
  • Manages per-project development environments via nix-shell or nix develop
  • Powers NixOS, a Linux distribution where the entire system is declared in a single configuration file
  • Caches and shares build results through binary substitution from remote caches

Architecture Overview

Every Nix package is defined by a derivation — a pure function from inputs (source, dependencies, build script) to a store path. The Nix store (/nix/store) holds all build outputs, each identified by a hash of its inputs. A build daemon executes derivations in sandboxed environments. Profiles are symlink trees pointing into the store, making switches atomic.

Self-Hosting & Configuration

  • Install with the official installer on any Linux distribution or macOS
  • Configure in /etc/nix/nix.conf or ~/.config/nix/nix.conf for substituters and features
  • Enable Flakes with experimental-features = nix-command flakes for the modern CLI
  • Use binary caches (cache.nixos.org or custom) to avoid rebuilding from source
  • Declare project dependencies in a flake.nix for portable reproducible environments

Key Features

  • Content-addressed store ensures bit-for-bit reproducible builds
  • Atomic upgrades with instant rollback to any previous generation
  • Multiple package versions coexist without conflicts or containers
  • Flakes provide hermetic, lockfile-based project definitions
  • Cross-compilation support for dozens of target platforms

Comparison with Similar Tools

  • Homebrew — simpler to start; no reproducibility guarantees or rollback support
  • apt/dnf — distribution-native; global state makes version conflicts common
  • Guix — similar functional model using Guile Scheme instead of the Nix language
  • Docker — provides isolation via containers; heavier weight than Nix shells for development

FAQ

Q: Do I need NixOS to use Nix? A: No. Nix runs as a package manager on any Linux distribution and on macOS.

Q: What are Flakes? A: Flakes are a newer interface for defining Nix projects with a lockfile for pinned dependencies, making builds fully reproducible across machines.

Q: Does Nix work on macOS? A: Yes. Nix supports macOS with a dedicated installer and the nix-darwin module for system configuration.

Q: How much disk space does the Nix store use? A: It varies. Run nix-collect-garbage -d to remove unused store paths and reclaim space.

Sources

Fil de discussion

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

Actifs similaires