Is there any way to get the graph of a dependency used in a project even though it’s not a direct input in the current project flakes.
nix path-info -r
will give runtime deps, add --derivation
to calculate build time deps, or nix-store - --requisites
on a derivation will be buildtime deps on an output path will be runtime deps closure
Thanks @Tim DeHerrera the above command returned all runtime deps. Is there any way to find the dependency graph . currently looking into nix-output-monitor (srid bro suggestion)
There are these two flags you can add to the nix-store
variant I suggested. From the man page:
* • --graph
* Prints the references graph of the store paths paths in the format of the dot tool of AT&T’s Graphviz package. This can be
* used to visualise dependency graphs. To obtain a build-time dependency graph, apply this to a store derivation. To obtain a
* runtime dependency graph, apply it to an output path.
* • --graphml
* Prints the references graph of the store paths paths in the GraphML file format. This can be used to visualise dependency
* graphs. To obtain a build-time dependency graph, apply this to a store derivation. To obtain a runtime dependency graph, ap‐
ply it to an output path.
If that is what you are looking for.
Thank you so much @Tim DeHerrera, This helped.
Nice, TIL!
nix-store --query --graph $(nix build --no-link --print-out-paths github:srid/emanote) | dot -Tsvg > output.svg
This is worth a candidate to https://nixos.asia/en/tips
Srid said:
Nice, TIL!
nix-store --query --graph $(nix build --no-link --print-out-paths github:srid/emanote) | dot -Tsvg > output.svg
Incidentally, this revealed to me that much of the bloat in emanote's closure is coming from nodejs (via tailwind).
Last updated: Nov 13 2024 at 11:45 UTC