Nix

ID

nix

Links

Home page · Documentation · Repository · Wikipedia

Upstream stars

⭐ 17,802

Last commit

2026-09-28

Version requirement

>= 2

Platforms

🐧 Linux · 🍎 macOS

Operations

installed · outdated · search · install · upgrade · upgrade_all · remove · sync · cleanup

purl types

pkg:nix/

CLI name

nix-env

Issues and PRs

📦 manager: nix

Source

nix.py

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.

What mpm adds to nix

Through mpm, nix gains --exact and --extended search, to narrow to exact names or match descriptions.

Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover nix alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your nix commands, in mpm

You already know nix: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With nix

With mpm

List what’s installed

nix-env --query --installed

mpm --nix installed

List outdated packages

nix-env --query --upgradeable --compare-versions

mpm --nix outdated

Search for a package

nix-env --query --available --attr-path --description 'hello'

mpm --nix search hello

Install a package

nix-env --install hello

mpm install pkg:nix/hello

Upgrade one package

nix-env --upgrade hello

mpm --nix upgrade hello

Upgrade everything

nix-env --upgrade

mpm --nix upgrade --all

Remove a package

nix-env --uninstall hello

mpm remove pkg:nix/hello

Clear caches

nix-collect-garbage --delete-old

mpm --nix cleanup --cache

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Operations

Operation

Supported

Notes

installed

✅

outdated

✅

orphans

search

✅

Exact and extended search backfilled by mpm.

install

✅

upgrade

✅

upgrade_all

✅

remove

✅

sync

✅

cleanup

✅

doctor

Configuration

  • Ignore nix on the mpm CLI by passing the --no-nix option.

  • Ignore it for every run in your configuration:

    [mpm]
    nix = false
    
  • Raise the timeout of all nix calls:

    [mpm.overrides.nix]
    timeout = 900
    
  • Run mpm config-template nix to print all overridable settings for your configuration file:

    [mpm.overrides.nix]
    cli_names = [
        "nix-env",
    ]
    cli_search_path = []
    dry_run = false
    ignore_auto_updates = true
    plan = false
    post_args = []
    pre_args = []
    pre_cmds = []
    requirement = ">=2.0.0"
    stop_on_error = false
    unmaintained = false
    version_cli_options = [
        "--version",
    ]
    version_regexes = [
        "nix-env \\(Nix\\) (?P<version>\\S+)",
    ]
    

Recipes

A few jobs you would otherwise script around nix, one mpm command each:

  • Snapshot and clone a machine: mpm --nix dump nix.toml, then mpm restore nix.toml on the next one.

  • Export a compliance SBOM: mpm --nix sbom (CycloneDX by default, --spdx for SPDX).

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.

None of its operations is privileged.

See privilege escalation for the full policy.

Cooldown

State of Nix’s release-age gating, from the cooldown support table:

Status: ❌ None

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

  • Registry: Git-manifest indexes

  • Retraction: Index revert: reverting the manifest, Portfile or derivation commit withdraws the version

  • Publish date: ❌ only the commit date, which is client-set and trivially backdated. A date declared in the manifest, like winget’s optional ReleaseDate, is author-supplied too and no sounder

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --cooldown best-effort opts back in.

Reference traces

A collection of raw native outputs captured from the manager’s own CLI and recorded in the manager source. 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

Version check

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+)"

Upstream project

Metrics

NixOS/nix

Activity

commit activity open issues open pull requests

Popularity

forks watchers contributors

Metadata

latest tag license main language

Changelog

  • 6.3.0 (2026-04-09)

    • Add Nix package manager with installed, outdated, search, install, upgrade, remove, sync, and cleanup support.