{
  callPackage,
  lib,
}: let
  latest = "deb64-rev26";

  releases = lib.mapAttrs (name: release: release // {name = name;}) (import ./releases.nix);

  overrideUnwrapped = default: new: let
    args = default // new;
    unwrappedPkgs = lib.filterAttrs (name: _: ! lib.elem name ["override" "overrideDerivation"]) (callPackage ./unwrapped.nix args);
  in
    lib.fix (unwrapped: lib.mapAttrs (_: pkg: callPackage pkg unwrapped) unwrappedPkgs)
    // {
      override = overrideUnwrapped args;
    };

  pkgsForRelease = release: let
    ase-pkcs11 = unwrapped.ase-idprotect.lib;
    libasep11 = "${ase-pkcs11}/lib/x64-athena/libASEP11.so";
    unwrapped = overrideUnwrapped {inherit release;} {};
  in {
    inherit ase-pkcs11 libasep11;
    inherit (unwrapped) ase-idprotect bccr-cacerts;

    gaudi = callPackage ./gaudi-env.nix {inherit unwrapped;};
    firmador = callPackage ./firmador.nix {inherit libasep11;};
  };
in
  lib.mapAttrs (_: pkgsForRelease) (releases // {latest = releases.${latest};})
