I really like the ability to use the nix-store to view the dependency closure of a binary.
For instance:
nix-store -q --tree $(which rg) | head
/nix/store/aadwihm59dsqri8m0hxvng19yxzmvi2g-home-manager-path
+---/nix/store/171f2jwybykw1lis9qv74mzh7brq7gkr-jq-1.6-man
+---/nix/store/212d94krlz0gmddwxkwfqdll9m5jhj6w-direnv-2.21.3
| +---/nix/store/2xf7xzc84pkn1g9fz3fdjq42pa5305qk-tzdata-2019c
| +---/nix/store/ypag3bh7y7i15xf24zihr343wi6x5i6g-bash-4.4-p23
| | +---/nix/store/bqbg6hb2jsl3kvf6jgmgfdqy06fpjrrn-glibc-2.30
| | | +---/nix/store/fhg84pzckx2igmcsvg92x1wpvl1dmybf-libidn2-2.3.0
| | | | +---/nix/store/y8n2b9nwjrgfx3kvi3vywvfib2cw5xa6-libunistring-0.9.10
| | | | | +---/nix/store/y8n2b9nwjrgfx3kvi3vywvfib2cw5xa6-libunistring-0.9.10 [...]
| | | | +---/nix/store/fhg84pzckx2igmcsvg92x1wpvl1dmybf-libidn2-2.3.0 [...]
Is there a similar way to get the output for a nix-shell derivation?
The problem is that the nix-shell does not seem to have a value in the nix-store.
I mean it has $out
but it’s unrealized– in fact you cannot even realize it since i’m using mkShell.
I would love to generate a GraphViz diagram for my project’s complete dependency from my shell.nix file
This question could be related to How to export nix-shell dependency for deploy
I see that I could echo $buildInputs
however it does not seem to capture all the dependencies; since I do inline some into the environment variables for instance.