|0.2.0||Feb 22, 2020|
|0.1.0||Feb 21, 2020|
#147 in GUI
22 downloads per month
nix-query-tree-viewer is a convenient way to visualize the output of
the dependencies of a given path in the Nix store.
This is the same tree information that
nix-store --query --tree <PATH> outputs,
nix-query-tree-viewer makes it easier to understand and interact with.
You can run
nix-query-tree-viewer by passing it a path in the Nix store:
$ nix-query-tree-viewer /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0
nix-query-tree-viewer can be installed with either Nix or Cargo.
$ nix-env -f channel:nixos-unstable -iA hello
This is convenient if you just want to use
$ cargo install nix-query-tree-viewer
You'll need to have GTK libraries available in your environment for this to work.
nix-store --query --tree can be used to see the dependencies of a
path in the Nix store in a tree format:
$ nix-store --query --tree /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0 /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0 +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 | +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...] +---/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23 | +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...] | +---/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23 [...] +---/nix/store/hlnxw4k6931bachvg5sv0cyaissimswb-gcc-7.4.0-lib | +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...] | +---/nix/store/hlnxw4k6931bachvg5sv0cyaissimswb-gcc-7.4.0-lib [...] +---/nix/store/f5wl80zkrd3fc1jxsljmnpn7y02lz6v1-glibc-2.27-bin | +---/nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27 [...] ...
This is fine for simple derivations, but it gets very complicated for paths with deep dependency trees.
nix-query-tree-viewer helps with this by folding branches of the tree by
default. Clicking on a branch allows you to drill down into interesting
For example, here is the same picture as above, but with two of the branches open:
You can use
nix-instantiate to easily find the paths for
For instance, if you want to find the path of
gcc in the Nix store, you can
$ nix-build '<nixpkgs>' -A gcc --no-out-link ... /nix/store/ghzg4kg0sjif58smj2lfm2bdvjwim85y-gcc-wrapper-7.4.0
If you want to find the path of the
.drv file for
gcc, you can use
$ nix-instantiate '<nixpkgs>' -A gcc ... /nix/store/dyxdjxyszmlz29mb0jr9qkncj5l41dai-gcc-wrapper-7.4.0.drv
You should be able to pass both
In general, passing the output of
let you see the run-time dependencies of a derivation, while passing the output
nix-instantiate will let you see the build-time dependencies of a
Feel free to open an issue or PR for any bugs/problems/suggestions/improvements.