Nix CLI
$ nix Foundation Low RiskPurely functional package manager and reproducible environment builder. Modern nix commands expose --json across eval, search, and flake show, plus --dry-run build planning, though daemon setup and flakes flags add onboarding friction.
https://nixos.org/download/ Evaluates local flake.nix derivations and builds /nix/store paths directly on the host.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
First-class --json on eval, search, flake show, and path-info, plus --dry-run and nix develop --command.
nix eval --jsonandnix flake show --jsonemit exact JSONnix build --dry-runpreviews build/fetch plans
Immutable /nix/store hashing and pure evaluation prevent mutating host libraries, with --dry-run before builds.
- Content-addressed
/nix/storeisolation
Requires multi-user daemon installation on Linux/macOS (Windows only via WSL2) and enabling nix-command flakes.
- No native Windows support outside WSL2
- Daemon installer and experimental-features config needed
Bit-for-bit reproducible devShells eliminate 'works on my machine' dependency drift for agents.
- Pinned
flake.lockguarantees exact tool versions
Backed by the NixOS Foundation under LGPL-2.1.
- Official
NixOS/nixrepository
Comprehensive manual at nix.dev, though legacy nix-* vs modern nix subcommands can confuse newcomers.
- Official reference at nix.dev/manual/nix/stable/
Security, Auth & Guardrails
Public store operations need no auth; optional GitHub access tokens or binary cache netrc files are configured in ~/.config/nix/nix.conf.
LGPL-2.1 open-source software; completely free.
# Nix CLI (nix) Agent Rules - Use `nix develop --command <cmd>` instead of bare `nix develop` so the shell does not enter an interactive subshell. - Run `nix flake show --json` and `nix build --dry-run` before triggering large derivations.
Agent-Ready Command Recipes
Safe Read-Only Queries
nix flake show --json
Enumerates packages, devShells, and checks exposed by flake.nix in JSON.
nix build --dry-run
Lists store paths that would be fetched or built without modifying /nix/store.
Controlled Writes & Previews
nix develop --command pytest
Enters the pinned flake.nix development environment non-interactively to run pytest.
Strengths for Agents
- +
nix eval --jsonandnix flake show --jsonprovide exact, structured metadata. - +
nix develop --command <cmd>executes tools inside reproducible pinned environments. - +
--dry-runpreviews every download or local derivation build.
Caveats & Pitfalls
- ! Heavy installer/daemon footprint and requires enabling
experimental-features = nix-command flakeson default installs. - ! Not natively supported on Windows without WSL2.