symphorien / nix-du

Visualise which gc-roots to delete to free some space in your nix store
GNU Lesser General Public License v3.0
371 stars 5 forks source link

allow user-settable splitting of classes #19

Open FavoritoHJS opened 12 months ago

FavoritoHJS commented 12 months ago

i think there should be a way to have some classes (a) labeled, like the root markers, and (b) represent some set of nodes, in such a way that those nodes will remain separated from another class even if they would otherwise be merged

something like

           +-<DE pkgs>
<gen. 123>-+-<heavy pkgs>
           +-<other>

instead of

<gen. 123>-+-<almost all pkgs>
           +-<like 3 pkgs, referred by some root somewhere>

reasoning: something i thought would be a good use for this tool is to see which packages are drawing the most - and the heaviest - dependencies, so i can see if there are some packages which i don't really need but are pulling heavy dependencies, or being a near-duplicate of an existing dependency, etc.

it might be a problem to ensure this doesn't break the tree-like nature of the graph, though...

tried asking in the nixos matrix server but got no answer aside from being sent here, so at the very least this will require more documentation.

symphorien commented 12 months ago

I think you might need nix-tree more than nix-du. nix-du was designed more about unexpectedly big gc roots than unexpectedly big packages. In some conditions it can reveal unexpectedly big packages (see example usage of --root in the readme) but it's a way to repurpose the tool rather than its original intended goal.

Besides I'm not sure how you classify packages. For example where does the "DE packages" class come from? How do you classify /nix/store/pxvfh2fmsn8dvkb8dm76k9c2z6g72jjb-cairo-1.16.0 ?