Nix-shell view dependency closure

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/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.

I have this crazy one-liner but i’m not 100% if it’s right

#1. First instantiate the shell.nix
#2. Pretty print the derivation to JSON
#3. Grep out the derivations (should use jq) but this works for nw
#4. Skip the first derivation; since that's our shell derivation & we can't instantiate it
#5. Turn the multiline into a single line
#6. Call nix-store query with forced realisation & requisites & replacing output paths for the derivations
nix-store --query -f --requisites -u \
$(nix show-derivation $(nix-instantiate shell.nix) | \
   grep -oE "/nix/store.*drv" | \
   tail -n+2 | \
   tr '\n' ' ')

Unfortunately; I can’t seem to get it to work with –tree since that doesn’t seem to work with -u as it shows drv dependencies only.