Get .drv for /etc/nixos/configuration.nix
nix-instantiate '<nixos>' -A system
nix show-derivation /nix/store/qfriughbauiryghbauiobfghvoiadfbuhgvadffhngvn.drv
Explore dependency tree of derivation
nix-tree /nix/store/qfriughbauiryghbauiobfghvoiadfbuhgvadffhngvn.drv
Build package from local nixpkgs
nix-shell -I nixpkgs=$(pwd) -p python38Packages.percol
source
nix --extra-experimental-features nix-command store diff-closures /run/{booted,current}-system
Get the store path for a package
source
nix-build '<nixpkgs>' --no-build-output -A snappy
Show why a package has another package in its closure
source
nix --extra-experimental-features nix-command why-depends /run/current-system /nix/store/hv5nhj0pc3zpnc3z44mvzbq0zjmgwcjr-snappy-1.1.9
Display a dependency diagram of any closure
nix-shell -p graphviz imagemagick --run 'nix-store -q --graph `which htop` | dot -Tsvg | display'
View nixos options from local nixpkgs
jq < $(nix-build nixos/release.nix -A options)/share/doc/nixos/options.json | less
python with packages using flakes
nix run --impure --expr '(import (__getFlake "nixpkgs") { }).python3.withPackages (p: [p.requests])'
pvesh get /cluster/nextid