Nix-shell find package, but nix-build doesnt

Hi, Im tring to package NTPoly, which requires a Fortran compiler.

I see gfortran13 is available in search.nixos.org.
I can install it with nix-shell -p gfortran13.
However when I add this as a build dependency in a flakei get the error

error: Function called without required argument "gfortran13" at <path-to-project>/ntpoly.nix:4, did you mean "gfortran10", "gfortran11" or "gfortran12"?

Whats going on?

Can you share your nix code? Otherwise we can just do wild guessing: Is the flake following a recent Nixpkgs?

Wineld Guess was correct

Thanks, it was the nixpkgs being out of date. I didn’t notice that it was tracking a particular version of the package index.

I needed to change nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-22.11"; to nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11";

Thank you <3

Code

Hear is a minimum example of what was breaking

# ntpoly.nix


{
    gfortran13,
    stdenv,
    fetchFromGitHub,
}:

stdenv.mkDerivation {

    pname = "NTPoly";
    version = "2.3.1";
    src = fetchFromGitHub {
        owner = "william-dawson";
        repo = "NTPoly";
        rev = "ntpoly-v2.3.1";
        hash="sha256-sOUN3Ja39YxtB0Vc7gdK5SjmGcOLcWN1CFN7LKgK0SY=";
    };

    buildInputs = [ gfortran13 ];

    configurePhase = ''
    echo do nothing
    '';

    buildPhase = ''
    echo do nothing
    '';

    installPhase = ''
    echo do nothing
    mkdir $out
    '';
}

# default.nix

let 
    nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-22.11";
    pkgs = import nixpkgs { config = {}; overlays = []; };
in {
    ntpoly = pkgs.callPackage ./ntpoly.nix { };
}