Nix Store using lots of space after clean up

I have been upgrading my Nixos after a long break and found it was using all the space on my small disk (100Gb), its now down to about 30Gb for the Nix store.
I found a utility nix-du and have a screenshot of the problem

Nix-du shows libqmi using 10.3Gb but I don’t think I fully believe that since I get:

du -s -b /nix/store/*libqmi*
3909 /nix/store/87nh6i57866vkflfvh1axgbmz20120kd-libqmi-1.32.4.drv
6582238 /nix/store/cxdkg3z9pr5jnc3wlan38xz7my51ccvn-libqmi-1.32.4
3905 /nix/store/wblplqf29gcbr01176x8mnib3q9aw4qm-libqmi-1.32.4.drv

Doesn’t 6Gb seem a bit too large for libqmi?

But what is worse is:

du -s -b /nix/store/*xdg-portals*
1153 /nix/store/05hnbim68b1gn911ncnxy9rkaj52igdc-xdg-portals
2818 /nix/store/sxj92v2y3mhq7sp096634h97ydj4gyri-xdg-portals.drv
And nix-du shows 4.5Gb.

I have done garbage collection and store optimize,
plus zero results from

nix-store --gc --print-roots | egrep -v “^(/nix/var|/run/\w±system|{memory|/proc)”

Any ideas?

I do not remember how nix-du works and why it shows such enormous sizes, but your du of libqmi shows 6.5MB and not 6.5GB which seems reasonable to me.

Ah, right. I need to look further into this thanks.

Nix-du shows libqmi using 10.3Gb

that does not mean that libqmi wheighs 10 GB, it means that there is a group of store paths, such that, if you wanted to delete them, you should remove the same set of gc roots, and this group wheighs 10 GB. Libqmi is one of these store paths, and was arbitrarily selected as the name of the group. If that confuses you, you can disregard the name of nodes which are not gc-roots. But in some cases the name is a useful hint.

1 Like