Nix¶
Nix, the functional package manager.
Note
All operations use the imperative nix-env interface, which manages
a per-user package profile. Declarative approaches (NixOS modules,
home-manager) are not covered.
Channel refresh (sync) and store garbage collection (cleanup) shell
out to the sibling nix-channel and nix-collect-garbage binaries
installed alongside nix-env, not to nix-env itself.
Home page: https://nixos.org
Version requirement:
>=2.0.0
Platforms¶
🐧 Linux
🍎 macOS
Operations¶
Operation |
Supported |
Notes |
|---|---|---|
|
✓ |
|
|
✓ |
|
|
✓ |
exact and extended search backfilled by |
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
Ecosystem¶
Accepted purl types:
pkg:nix
Usage¶
$ mpm --nix installed
$ mpm --nix search "query"
$ mpm --nix upgrade --all
$ mpm install pkg:nix/hello
$ mpm --dry-run --nix upgrade --all
Every example above accepts --dry-run, which simulates the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Deselect the manager for a single run with --no-nix, disable it from your configuration, or tune its invocation attributes with per-manager overrides.
Command line¶
CLI names, in lookup order:
nix-env
The version is probed by running:
$ nix-env --version
nix-env (Nix) 2.18.1
and extracted with:
r"nix-env \(Nix\) (?P<version>\S+)"
Privilege escalation¶
mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.
See privilege escalation for the full policy.
Cooldown¶
State of Nix’s release-age gating, from the cooldown support table:
Status: ❌ None
With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.
Reference traces¶
Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know Nix well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ nix-env --query --installed
hello-2.12.1
nix-2.18.1
python3-3.11.6
$ nix-env --query --upgradeable --compare-versions
hello-2.12.1 < 2.13.0
python3-3.11.6 < 3.12.0