Dependency Tracing
Dependency tracing in Nix allows you to understand the relationships between packages in your system configuration.
Forward Path Tracing
This section answers the question: "What are the dependencies of an installed package?"
Print a store path's dependency tree with:
Get a package's store path with:
Replace
YOUR_CONFIG
with the name of your NixOS or Home Manager configuration, andPACKAGE
with the name of the package you want to analyze.
NixOS
Home Manager
Backward Path Tracing
This section answers the question: "What are parents of an installed package?" or "Why is a certain package installed?"
Print a package's dependency path with:
Replace
YOUR_CONFIG
with the name of your NixOS or Home Manager configuration, andPACKAGE
with the name of the package you want to analyze.
NixOS
nix why-depends --derivation ~/.config/nixos#nixosConfigurations.YOUR_CONFIG.config.system.build.toplevel ~/.config/nixos#nixosConfigurations.YOUR_CONFIG.pkgs.PACKAGE