In the olden days when we had directories I’d use du and see which dirs were large and then go hunting to delete things.
Is there a way to see disk space usage by installed package tree?
I’m guessing things get murky with hardlinks but I just need a gist of what’s big.
danbst
February 16, 2020, 11:35am
2
1 Like
bhipple
February 16, 2020, 6:29pm
3
This looks promising for your use case, if what you’re really trying to do is answer “what gcroots would it be helpful to remove to significantly reduce disk consumption in the store (globally)”.
If you’re just looking to get information about why a particular package is big (in isolation, not considering the rest of the store), try nix path-info
, like so:
$ nix path-info -rhsS /nix/store/cnp0x2lh22x6mb4p6ng6xskx5p3ycj1c-python2.7-numpy-1.16.5 | sort -hk3
/nix/store/mxaxvp33wg9sim8qh2kkw041v492bvxj-libunistring-0.9.10 1.6M 1.6M
/nix/store/hjng28vbd73qq9iz9j8r397x19aa8fp9-libidn2-2.3.0 217.5K 1.8M
/nix/store/8g1v3sf0xvf044sz1b4kcrg1i86z9bh7-glibc-2.30 29.6M 31.4M
/nix/store/3qwd41p2cwam035r3ik62ri4dcrgmlyg-attr-2.4.48 87.0K 31.5M
/nix/store/hxvhr0qx0jp2ald2lc5w71zkp534svpx-bzip2-1.0.6.0.1 79.0K 31.5M
/nix/store/s80jmwnnr5sa5hvxkdz44ksvbng1rycc-zlib-1.2.11 121.4K 31.5M
/nix/store/g3vkfhbh0j5dg2i0ja4rz6bspkb46k3r-acl-2.2.53 107.3K 31.6M
/nix/store/j2igapdwgxm9qc01ihnqq6hm5i988943-gdbm-1.18.1 644.8K 32.0M
/nix/store/vrnxw026hiy8jvdpaaix47x528bkzksk-bash-4.4-p23 1.3M 32.7M
/nix/store/i5xihvm2c8b22w3ykc05an42vkka228p-sqlite-3.31.0 1.2M 32.8M
/nix/store/scgxalx94hbc60px2bazzap0n3n3w897-coreutils-8.31 1.8M 33.4M
/nix/store/18g0mnrxq829yw1fdn6lr92icsi97irb-ncurses-6.1-20190112 3.4M 34.8M
/nix/store/ghww00qrv0hk69z7lb4y6hnadalggn8h-readline-6.3p08 382.7K 35.2M
/nix/store/814wbxsa1xwbc9dba504ryfqaykzqvb4-openssl-1.1.1d 4.0M 35.4M
/nix/store/34zpi8brqj78h842ski7swaj7psrl85b-gcc-9.2.0-lib 6.0M 37.4M
/nix/store/04gx0qda274hygh3mkbb334fk0rzxs91-gfortran-9.2.0-lib 8.6M 40.0M
/nix/store/lnx06v8j2wwc56zr6wszr05xf6z3nhlq-db-5.3.28 4.0M 41.4M
/nix/store/vb35v6lsgi0qjx79p8vykd95pvl39dna-openblas-0.3.7 28.1M 68.0M
/nix/store/pcnxabyxwxr2aqws261ygd14b8jhc9m2-python-2.7.17 44.8M 99.2M
/nix/store/cnp0x2lh22x6mb4p6ng6xskx5p3ycj1c-python2.7-numpy-1.16.5 23.1M 158.9M
This can be useful for answering questions like “why is my runtime closure install for X so huge”.
5 Likes