`nix why-depends` of local derivation

Hello everyone!

I want to know why my shell derivation depends on a certain package, using nix why-depends. However, I have no idea what the syntax should be.

The shell is defined in a default.nix and the first step would be probably to find the package-name.
Using nix build -f default.nix && nix show-derivation $(readlink result) I was able to look at the derivation and see the name, but seemingly that is not the package name?

Just found out that nix why-depends -f default.nix (readlink result) seems to be working, but I can’t really get it to show me the dependencies…

E.g. I have seen it doing:

copying path '/nix/store/cpqy1536md77m0shiaa714fafyyx9r91-linux-5.4.72-dev' from 'https://cache.nixos.org'...


> nix why-depends -f default.nix (readlink result) linux-5.4.72-dev
error: don't know what to do with argument 'linux-5.4.72-dev'

and neither does

> nix why-depends -f default.nix (readlink result) nixpkgs.linux-5.4.72-dev
error: don't know what to do with argument 'nixpkgs.linux-5.4.72-dev'

or something like that work.

Maybe it is important that default.nix uses niv for pinning the nixpkgs version.