Cross Compiling with gfortran as nativeBuildInput

I’d like to cross compile python3Packages.scipy. It has a gfortran in it’s nativeBuildInputs. Using nix eval --json, I noticed that this gfortran derivation path is:

/nix/store/5fivd5a8gil609z6yiwp3gkr2rmxd3pg-armv7l-unknown-linux-gnueabihf-stage-final-gfortran-wrapper-11.3.0

However, the derivation path of pkgsCross.${my_platform}.gfortran is:

/nix/store/i96zgmxw3afdyp1mys0z2pda9x0ji2y3-gfortran-wrapper-11.3.0

It’s a different path, and the later fails to compile. What is the attribute path for the first gfortran? The one that the cross compilation infrastructure overrides? I need this path to refer to it in a string inside the derivation…

If anyone needs to see more code at hand, my attempt is here:

Found it!

It’s buildPackages.gfortran.