Skip to content

Instantly share code, notes, and snippets.

@srhb
Created August 25, 2018 08:20
Show Gist options
  • Save srhb/555e0cfa1242d429937245867c3b7ae4 to your computer and use it in GitHub Desktop.
Save srhb/555e0cfa1242d429937245867c3b7ae4 to your computer and use it in GitHub Desktop.
Usage: nix why-depends <FLAGS>... <PACKAGE> <DEPENDENCY>
Summary: show why a package has another package in its closure.
Flags:
-a, --all show all edges in the dependency graph leading from 'package' to 'dependency', rather than just a shortest path
--arg <NAME> <EXPR> argument to be passed to Nix functions
--argstr <NAME> <STRING> string-valued argument to be passed to Nix functions
-f, --file <FILE> evaluate FILE rather than the default
-I, --include <PATH> add a path to the list of locations used to look up <...> file names
Examples:
To show one path through the dependency graph leading from Hello to Glibc:
$ nix why-depends nixpkgs.hello nixpkgs.glibc
To show all files and paths in the dependency graph leading from Thunderbird to libX11:
$ nix why-depends --all nixpkgs.thunderbird nixpkgs.xorg.libX11
To show why Glibc depends on itself:
$ nix why-depends nixpkgs.glibc nixpkgs.glibc
Note: this program is EXPERIMENTAL and subject to change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment