AgentSkillsCN

Nix

Nix

SKILL.md

Nix — Purely Functional Package Manager

Nix is a purely functional package manager that treats packages as values in a functional programming language — built by pure functions with no side effects, never overwritten after creation. This skill covers the complete Nix manual: language reference, store internals, command-line tools, and protocols.

Key properties:

  • Reproducible: Hermetic builds via pure function semantics — same inputs always produce the same outputs
  • Declarative: Package descriptions are Nix expressions, not imperative scripts
  • Reliable: Atomic upgrades/rollbacks, multiple versions coexist, garbage collection for unused paths
  • Multi-user: Unprivileged users can install packages securely without root

When to use this skill

Invoke when the user asks about:

  • Nix language syntax, builtins, derivations, or evaluation semantics
  • Nix store concepts (store paths, content addressing, file system objects)
  • Nix CLI commands (nix-build, nix-env, nix-store, nix-shell, etc.)
  • Package management (profiles, channels, garbage collection, binary caches)
  • Distributed/remote builds, build reproducibility, caching strategies
  • Nix protocols (NAR format, store path calculation, JSON formats)
  • Nix internals, architecture, or contributing to Nix development

Additional Resources

Overview

  • Introduction — What Nix is and its core features
  • Quick Start — Minimal getting-started guide (install, run, search, GC)
  • Glossary — Definitions of Nix terminology (derivation, store path, closure, etc.)
  • Table of Contents — Master hierarchical index of the entire manual

Installation

Nix Language

Nix Store

Package Management

Command Reference

Main Commands

nix-env Subcommands

nix-store Subcommands

Files

Advanced Topics

Protocols

Architecture

  • Architecture — Internal component hierarchy and concept map

Development (Contributing to Nix)

C API

  • C API — In-development stable C API with auto-generated documentation

Release Notes

Assets

  • figures/user-environments.png — User environments diagram
  • figures/user-environments.sxd — Source for user environments diagram