Files
nix-config/packages/raspberrypi/uefi-rpi5/default.nix
mjallen18 88e81c9aaa pi stufF
2026-01-07 15:32:50 -06:00

63 lines
1.3 KiB
Nix

{
lib,
stdenvNoCC,
fetchurl,
}:
let
defaultConfig = ''
EOF
armstub=RPI_EFI.fd
# device_tree_address=0x3e0000
# device_tree_end=0x400000
device_tree_address=0x1f0000
device_tree_end=0x210000
# Force 32 bpp framebuffer allocation.
framebuffer_depth=32
# Disable compensation for displays with overscan.
disable_overscan=1
# Force maximum USB power regardless of the power supply.
usb_max_current_enable=1
# Force maximum CPU speed.
force_turbo=1
EOF
'';
in
stdenvNoCC.mkDerivation rec {
pname = "uefi-rpi5";
version = "test1";
src = fetchurl {
url = "https://github.com/NumberOneGit/rpi5-uefi/releases/download/${version}/RPI_EFI.fd";
hash = "sha256-GIgru10KCol9PXcdgR2d1BHf2In07OQ2P1kru7GUupY=";
};
sourceRoot = ".";
dontUnpack = true;
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/RPI_EFI.fd"
cat > "$out/config.txt" << ${defaultConfig}
runHook postInstall
'';
meta = with lib; {
description = "RPI5 UEFI firmware";
homepage = "https://github.com/NumberOneGit/rpi5-uefi";
platforms = platforms.linux;
maintainers = with maintainers; [ ];
};
}