{
  lib,
  stdenvNoCC,
  fetchzip,
}:

stdenvNoCC.mkDerivation rec {
  pname = "uefi-rpi4";
  version = "1.50";

  src = fetchzip {
    url = "https://github.com/pftf/RPi4/releases/download/v${version}/RPi4_UEFI_Firmware_v${version}.zip";
    stripRoot = false;
    hash = "sha256-g8046/Ox0hZgvU6u3ZfC6HMqoTME0Y7NsZD6NvUsp7w=";
  };

  sourceRoot = ".";

  dontBuild = true;
  # Firmware blobs do not need fixing and should not be modified
  dontFixup = true;

  installPhase = ''
    runHook preInstall
    mkdir -p "$out"

    cp -rv "${src}/." "$out"
    # cp -rv "${src}/RPI_EFI.fd" "$out"
    # cp -rv "${src}/config.txt" "$out"

    runHook postInstall
  '';

  meta = with lib; {
    description = "RPI4 UEFI firmware";
    homepage = "https://github.com/pftf/RPi4";
    platforms = platforms.linux;
    maintainers = with maintainers; [ ];
  };
}
