Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Latest commit

 

History

History
54 lines (36 loc) · 1.06 KB

cheatsheet.md

File metadata and controls

54 lines (36 loc) · 1.06 KB

Cheat sheet

Show GC roots

nix-store --gc --print-roots | grep -v "<hostName>" | column -t | sort -k3 -k1

List all packages

nix-store -q --requisites /run/current-system | cut -d- -f2- | sort | uniq

Tip

You can add a wc -l at the end of the above command, but that will not be an accurate representation of your package count, as the same package can be repeated with different versions.

Find biggest packages

nix path-info -hsr /run/current-system/ | sort -hrk2 | head -n 30

Find biggest closures (packages including dependencies)

nix path-info -hSr /run/current-system/ | sort -hrk2 | head -n 10

Show package dependencies as tree

Assuming hello is in PATH

nix-store -q --tree $(realpath $(which hello))

Show package dependencies including size

nix path-info -hSr nixpkgs#hello

Show the things that will change on reboot

diff <(nix-store -qR /run/current-system) <(nix-store -qR  /run/booted-system)