How to find uncached dependencies of a closure?

or in other words: how can i figure out what dependencies of a package aren’t on cache.nixos.org?

my initial method was the following in fish

nix path-info --recursive /run/current-system | while read path
  nix path-info $path --store https://cache.nixos.org 2>> uncached
end

which does work – albeit with not very nice output

don't know how to build these paths:
  /nix/store/0h9qcm7r7s7ilpmbgxdbz2kvccglx5gx-bash_profile
error: path '/nix/store/0h9qcm7r7s7ilpmbgxdbz2kvccglx5gx-bash_profile' is not valid
don't know how to build these paths:
  /nix/store/0pmdkk5jrzyd66im4q7z0a24isyjix4a-wrapped-bash
error: path '/nix/store/0pmdkk5jrzyd66im4q7z0a24isyjix4a-wrapped-bash' is not valid

but it is pretty slow and can make up to 1000+ individual requests. does anyone know of a more efficient way to do this? i’m mainly trying to figure out the size of the footprint for some of my devices in a private cache, as well as trying to catch any larger things i might be rebuilding without realizing (garnix has been too useful for me in the last few months :laughing:)

thanks!