Find nixos dependency list

I am trying to upgrade the nixos from 21.11 to 22.11, when I do
‘‘sudo nixos-rebuild switch’’
it reported the failure
“hatch-vcs-0.2.0 not suported for interpreter python2.7”

I did not find where I used the python 2.7, and hatch-vcs is not explicitly used,. --show-trace does not really help finding the issue.

Is there a good way to trace down which module uses the hatch-vcs-0.2.0 ?

Thanks

nix why-depends --derivation <system's .drv> <package's .drv> should tell you if you have the new CLI enabled. If not, you can probably do the same thing with nix-store --query somehow.