{
  branch,
  qt6Packages,
  fetchFromGitLab,
  fetchurl,
}:

let
  # Fetched from https://api.citra-emu.org/gamedb
  # Please make sure to update this when updating citra!
  compat-list = fetchurl {
    name = "citra-compat-list";
    url = "https://web.archive.org/web/20230807103651/https://api.citra-emu.org/gamedb/";
    hash = "sha256-J+zqtWde5NgK2QROvGewtXGRAWUTNSKHNMG6iu9m1fU=";
  };
in
{
  nightly = qt6Packages.callPackage ./generic.nix (
    let
      version = "2104";
    in
    {
      pname = "citra-nightly";
      inherit
        version
        branch
        compat-list
        ;

      src = fetchFromGitLab {
        owner = "CaptainJawZ";
        repo = "Citra-Nightly";
        rev = "nightly-${version}";
        sha256 = "0ggi1l8327s43xaxs616g0s9vmal6q7vsv69bn07gp71gchhcmyi";
        fetchSubmodules = true;
      };

    }
  );
}
.${branch}
