1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/nix.md
Peter Bittner 64ff8c9df8
nix: update more information link to be more precise (#16286)
Use deep link to (experimental) nix command
2025-04-28 20:46:35 +03:00

1.2 KiB

nix

A powerful package manager that makes package management reliable, reproducible, and declarative. nix is experimental and requires enabling experimental features. For a classic, stable interface, see tldr nix classic. Some subcommands such as build, develop, flake, registry, profile, search, repl, store, edit, why-depends, etc. have their own usage documentation. More information: https://nix.dev/manual/nix/stable/command-ref/new-cli/nix.

  • Enable the nix command:

mkdir {{[-p|--parents]}} ~/.config/nix; echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf

  • 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}}