{ lib, stdenvNoCC, fetchFromGitHub, }: stdenvNoCC.mkDerivation { pname = "raspberrypi-wireless-firmware"; version = "0-unstable-2026-11-23"; srcs = [ (fetchFromGitHub { name = "bluez-firmware"; owner = "RPi-Distro"; repo = "bluez-firmware"; rev = "924fde7d1f0613d796e4512ac44ac33e4b91c4e3"; hash = "sha256-Ff0pzWidPgoEXpBqh81jmQWcpW90J1hH+gY61Wb8TEk="; }) (fetchFromGitHub { name = "firmware-nonfree"; owner = "RPi-Distro"; repo = "firmware-nonfree"; rev = "b1833f18a816cf8fd73ca86e27f9eecea11bf991"; hash = "sha256-fe2oZV/qPBkemtG34cx9s2+4RhMn5XF0zl3EkmFDiZg="; }) ]; sourceRoot = "."; dontBuild = true; # Firmware blobs do not need fixing and should not be modified dontFixup = true; installPhase = '' runHook preInstall mkdir -p "$out/lib/firmware/brcm" # Wifi firmware cp -r "firmware-nonfree/debian/added-firmware/brcm" "$out/lib/firmware/" cp -r "firmware-nonfree/debian/added-firmware/cypress" "$out/lib/firmware/" # Bluetooth firmware cp -r "bluez-firmware/debian/firmware/broadcom/." "$out/lib/firmware/brcm" # The brcmfmac43455-sdio.raspberrypi,*.bin board firmwares (Pi 3A+/3B+/CM4/4B/500/CM5/5B) # symlink to ../cypress/cyfmac43455-sdio.bin, which RPi-Distro ships only as the # cyfmac43455-sdio-standard.bin variant. Create the missing target so they resolve. # See https://github.com/RPi-Distro/firmware-nonfree/issues/26 ln -s "./cyfmac43455-sdio-standard.bin" "$out/lib/firmware/cypress/cyfmac43455-sdio.bin" runHook postInstall ''; meta = { description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W"; homepage = "https://github.com/RPi-Distro/firmware-nonfree"; license = lib.licenses.unfreeRedistributableFirmware; maintainers = with lib.maintainers; [ lopsided98 ]; platforms = lib.platforms.linux; sourceProvenance = with lib.sourceTypes; [ binaryFirmware ]; }; }