I have installed nixos.gfortran, but when I compile a f90 program with -lgfortran, it complains that it cannot find this lib.
I have tried gfortran.lib gfortran.dev in default.nix, but neigher can be recognized.
gfortran is a compiler wrapper around gcc.
You can access the unwrapped version through the .cc attribute.
If you add gfortran.cc to buildInputs this will add libgfortran to your compiler link path:
# save as shell.nix
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "env";
buildInputs = [
gfortran
gfortran.cc
];
}