Awesome Open Source
Awesome Open Source


Build Status Packaging status

Interactively browse dependency graphs of Nix derivations.



nix-tree is on nixpkgs since 20.09, so just use your preferred method for adding packages to your system, eg:

nix-env -i nix-tree

To run the current development version:

nix-shell -p '(import (builtins.fetchTarball "") {}).nix-tree' --run nix-tree

Or, if you use a Nix version with flake support:

nix run github:utdemir/nix-tree


$ nix-tree --help
Usage: nix-tree [paths...] [-h|--help] [--version]
  Paths default to $HOME/.nix-profile and /var/run/current-system.
  hjkl/Arrow Keys : Navigate
  w               : Open why-depends mode
  /               : Open search mode
  s               : Change sort order
  y               : Yank selected path to clipboard
  ?               : Show help
  q/Esc:          : Quit / close modal


  • NAR Size: Size of the store path itself.
  • Closure size: Total size of the store path and all its transitive dependencies.
  • Added size: Size of the store path, and all its unique transitive dependencies. In other words, the cost of having that store path on top of all other paths. See issue #14 for a better explanation.


nix-build prints built paths to stdout, which can be piped conveniently with | xargs -o nix-tree. Examples:

# Output of a local derivation
nix-build . --no-out-link | xargs -o nix-tree

# Build time dependencies (passing a `.drv` path)
nix-instantiate --no-out-link | xargs -o nix-tree

# Dependencies from shell.nix
nix-build shell.nix -A inputDerivation | xargs -o nix-tree

# All outputs of a derivation in nixpkgs:
nix-build '<nixpkgs>' -A openssl.all --no-out-link | xargs -o nix-tree


All contributions, issues and feature requests are welcome.

To hack on it, simply run nix-shell and use cabal as usual. Please run ./ before sending a PR.

Related tools

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
haskell (1,649
nix (188
dependency-graph (29