summaryrefslogtreecommitdiff
path: root/nix-audit-sizes
blob: b36278cfc19d157f8b241872332abac7641e540c (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
#
echo "# this takes a while, be patient..."
roots=$(find -H /nix/var/nix/gcroots/auto -type l)
for root in $roots
do
  link=$(readlink $root)
  storepath=$(realpath $link)
  size=$(nix-store -q --requisites $storepath | sort -uf | xargs du -ch | tail -1 | sed 's/[ ]*total//g')
  printf "%s\n\t%s\n\t%s\n\n" $size $link $storepath
done