Nix-graph: Small TUI tool to explore nix dependency graph

TLDR: nix-tree on steroids.

demo

Not sure whether spending my off-work time on this was worth it, but i think, the tool actually turned out pretty decent for figuring out what’s taking up space in the store and exploring dependency graph.

p.s. Can’t chose Announcements category, so I’ll leave this here.

16 Likes

This looks great, and I haven’t even tried it yet :grin:! The code is pretty short and simple, and with plenty of tests.

Any plans to add this to nixpkgs?

2 Likes

Thanks! If people end up liking the tool and find it useful, I’d be happy to add it to nixpkgs.

2 Likes

I was going to be “that guy” and immediately ask for more:

  • Showing more of the store path if there’s room, as I’m seeing `│ [-] 292k…q3 nixos-system-sus-26.11.20260905.c043004[66 spaces]41.0G[…]`
  • An s shortcut to open $SHELL in the relevant directory.

But they aren’t really necessary, since a simple yp copies the full store path. Keeping it simple :heart:

No problem, the s shortcut sounds pretty reasonable, I’ll add it when I get some time.

As for showing more of the store path, I’m honestly not 100% sure what the best way to handle this. Showing /nix/store/doesn’t seem particularly useful since all paths in the store. Showing the full hash is an option, but I tried displaying the full hash in some of the earlier iterations and it didn’t look great, 32 characters of chaotic text take up a lot of space.

I assume the main issue here is making it easier to tell which columns belong to which row. Maybe an optional zebra background for rows or something along those lines would work better.

Anyway, I’ve added both ideas to the backlog, so I’ll get to them eventually.

Thank you for sharing! Looks neat.

Consider adding to Nixpkgs and supporting non-flake consumption.

3 Likes