Files
matej.nix/dist/nix-cheatsheet.md
2026-03-04 09:51:32 +01:00

864 B

Nix package manager cheatsheet

Search for packages

nix search nixpkgs python

Add packages to current shell

# single package
nix shell nixpkgs#python3

# multiple packages
nix shell nixpkgs#python3 nixpkgs#nodejs

Run a command directly

nix run nixpkgs#python3 -- --version

Install packages persistently (available in new SSH sessions)

# nix shell packages are lost when the session ends
# use profile install to persist across sessions
# packages use the nixpkgs# prefix
nix profile install nixpkgs#nodejs nixpkgs#pnpm nixpkgs#yarn

Language stacks

Stack Packages
Node.js nodejs, pnpm, yarn
Python python3, python3Packages.pip, python3Packages.virtualenv, uv
Go go
Rust cargo, rustc, rustfmt, clippy
Foundry foundry