nix-store --gc --print-roots | grep -v "<hostName>" | column -t | sort -k3 -k1
nix-store -q --requisites /run/current-system | cut -d- -f2- | sort | uniq
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.
nix path-info -hsr /run/current-system/ | sort -hrk2 | head -n10
nix path-info -hSr /run/current-system/ | sort -hrk2 | head -n10
Assuming
hello
is in PATH
nix-store -q --tree $(realpath $(which hello))
nix path-info -hSr nixpkgs#hello
diff <(nix-store -qR /run/current-system) <(nix-store -qR /run/booted-system)