2025-03-14 21:59:59 -06:00
|
|
|
# nix classic
|
|
|
|
|
|
|
|
|
|
> A classic, stable interface to a powerful package manager that makes package management reliable, reproducible, and declarative.
|
2025-07-24 22:27:13 -06:00
|
|
|
> Some Nix commands such as `nix-build`, `nix-shell`, `nix-env`, and `nix-store` have their own pages.
|
|
|
|
|
> See also: `nix`.
|
2025-03-14 21:59:59 -06:00
|
|
|
> More information: <https://nixos.org>.
|
|
|
|
|
|
|
|
|
|
- Search for a package in nixpkgs via its name:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`nix-env {{[-qaP|--query --available --attr-path]}} {{search_term_regexp}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Start a shell with the specified packages available:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`nix-shell {{[-p|--packages]}} {{pkg1 pkg2 pkg3 ...}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Install some packages permanently:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`nix-env {{[-iA|--install --attr]}} {{nixpkgs.pkg1 nixpkgs.pkg2 ...}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Show all dependencies of a store path (package), in a tree format:
|
|
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
`nix-store {{[-q|--query]}} --tree /nix/store/{{checksum-package-version.ext}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Update the channels (repositories):
|
|
|
|
|
|
|
|
|
|
`nix-channel --update`
|
|
|
|
|
|
|
|
|
|
- Remove unused paths from Nix store:
|
|
|
|
|
|
|
|
|
|
`nix-collect-garbage`
|