mirror of
https://github.com/utdemir/nix-tree.git
synced 2024-09-11 14:55:44 +03:00
Interactively browse dependency graphs of Nix derivations.
This _should_ enable nix-tree to work on non-standard store paths. Not tested yet, since I do not have a setup like that. Main changes: * Fetch store path at the beginning (`getNixStore` function) * Make `StoreName`'s also contain a NixStore * Make `InvertedIndex` similar to a `Map` rather than a `Set` |
||
---|---|---|
.github/workflows | ||
src | ||
test | ||
.envrc | ||
.ghci | ||
.gitignore | ||
asciicast.sh | ||
CHANGELOG.md | ||
default.nix | ||
flake.lock | ||
flake.nix | ||
format.sh | ||
LICENSE | ||
nix-tree.cabal | ||
README.md | ||
shell.nix |
nix-tree
Interactively browse the dependency graph of your Nix derivations.
Installation
Stable version:
nix-env -i nix-tree
Development version (requires Nix with flake support):
nix profile install github:utdemir/nix-tree
Usage
$ nix-tree --help
nix-tree --help
Usage: nix-tree [paths] [-h|--help]
Paths default to $HOME/.nix-profile and /var/run/current-system.
Keybindings:
hjkl/Arrow Keys : Navigate
q/Esc: : Quit / close modal
w : Open why-depends mode
/ : Open search mode
s : Change sort order
? : Show help
Glossary
- 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.
Tips
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
Hacking
All contributions, issues and feature requests are welcome.
To hack on it, simply run nix-shell
(or nix develop
) and use cabal
as usual.