2025-03-14 21:59:59 -06:00
# nix
> A powerful package manager that makes package management reliable, reproducible, and declarative.
2025-07-24 22:27:13 -06:00
> `nix` is experimental and requires enabling experimental features.
> See also: `nix classic` for a classic, stable interface.
2025-03-14 21:59:59 -06:00
> Some subcommands such as `build`, `develop`, `flake`, `registry`, `profile`, `search`, `repl`, `store`, `edit`, `why-depends`, etc. have their own usage documentation.
2025-05-08 12:26:01 -06:00
> More information: <https://nix.dev/manual/nix/stable/command-ref/new-cli/nix>.
2025-03-14 21:59:59 -06:00
- Enable the `nix` command:
2025-05-08 12:26:01 -06:00
`mkdir {{[-p|--parents]}} ~/.config/nix; echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf`
2025-03-14 21:59:59 -06:00
- Search for a package in nixpkgs via its name or description:
`nix search nixpkgs {{search_term}}`
- Start a shell with the specified packages from nixpkgs available:
`nix shell {{nixpkgs#pkg1 nixpkgs#pkg2 nixpkgs#pkg3 ...}}`
- Install some packages from nixpkgs permanently:
`nix profile install {{nixpkgs#pkg1 nixpkgs#pkg2 nixpkgs#pkg3 ...}}`
- Remove unused paths from Nix store to free up space:
`nix store gc`
- Start an interactive environment for evaluating Nix expressions:
`nix repl`
- Display help for a specific subcommand:
`nix help {{subcommand}}`