Visualize which Nix garbage collection roots to delete to free space in your Nix store.
nix-du is a command-line tool for the Nix package manager that visualizes disk usage in the Nix store. It generates dependency graphs showing which garbage collection roots are retaining packages, helping users identify what to delete to free up space. It solves the problem of understanding why certain packages persist and how much space they consume.
Nix and NixOS users, system administrators, and developers who manage Nix-based environments and need to optimize storage by removing unnecessary packages.
Developers choose nix-du because it provides clear, visual insights into Nix store dependencies that traditional garbage collection tools lack, enabling targeted space reclamation without guesswork. Its focus on diagnostics without store modification ensures safe analysis.
Visualise which gc-roots to delete to free some space in your nix store
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates color-coded graphs showing which gc-roots retain packages, enabling targeted deletion decisions as demonstrated in the screenshots with root and profile nodes.
Allows inspection of specific store paths like user profiles or system packages, with examples for nix-env and NixOS configurations in the README.
Offers size (-s) and node count (-n) filters to simplify large graphs, making them readable with tools like dot, as explained in the filters section.
Provides precision levels (-O0, -O1, -O2) to account for file hard links from store optimization, ensuring realistic size reports despite slower scans.
Understanding node names and edge meanings requires deep Nix knowledge, as admitted in the FAQ where names can be meaningless or misleading.
Outputs in DOT format, necessitating additional tools like Graphviz or zgrviewer for rendering, which adds setup steps and complexity beyond the core tool.
Using filters leads to size approximations, potentially misleading users about actual space savings, as warned in the documentation about inaccuracies.
Full deduplication detection (-O2) is time-consuming, especially on hard drives, making accurate reports impractical for frequent use, per the caveats.