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:


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


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.