what is it?
a purely functional package manager. This means that it treats packages like values in purely functional programming languages such as Haskell
installation
official method
multi-user installation on Linux
sh <(curl -L https://nixos.org/nix/install) --daemondeterminate systems installer
an alternative to the official method with some benefits
- installs nix with flakes support and the unified CLI
- easier uninstallation
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- installcleaning up space
nix-store --verify --check-contents --repair
nix-collect-garbage
# leaves only a single generation, prevents rollback
nix-collect-garbage --delete-oldnix-store --optimize replaces copies with hardlinks, cutting down on disk space
review nix-store --gc --print-roots and decide if there are roots that can be removed
running a program
running vim from the nixpkgs flake (without installing it)
nix run nixpkgs#vimshell
run a shell in which the specified packages are available
# shell providing GNU Hello from NixOS 20.03
nix shell nixpkgs/nixos-20.03#hello
# install multiple packages
nix shell nixpkgs#uv nixpkgs#libpqxxconfiguration
# use as many jobs as number of CPUs for builder
max-jobs = auto