2022-08-21 13:32:41 +00:00
|
|
|
{ lib, stdenvNoCC, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
stdenvNoCC.mkDerivation {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "raspberrypi-wireless-firmware";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "2022-07-06";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
srcs = [
|
|
|
|
(fetchFromGitHub {
|
|
|
|
name = "bluez-firmware";
|
|
|
|
owner = "RPi-Distro";
|
|
|
|
repo = "bluez-firmware";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "dd840d991939f5046959b8c564596c7228f9d41d";
|
|
|
|
hash = "sha512-XvF6IHDoKBJkSs0Wyt8O1vcCMpSNS9WSYopn0+EyCr4btABGsHWTkgxb4nQbd+VbE6Ls2dcKr+c+X6aw/y1jhQ==";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
(fetchFromGitHub {
|
|
|
|
name = "firmware-nonfree";
|
|
|
|
owner = "RPi-Distro";
|
|
|
|
repo = "firmware-nonfree";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "541e5a05d152e7e6f0d9be45622e4a3741e51c02";
|
|
|
|
hash = "sha512-0erVWiFom0V5AMu+XlolJnY9Q5/RCFlZwUovMBMNdEPb+L5rHcCdrA7zehDX1oRNe8DPb4S5gjny0iG/G7G6NQ==";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
# Firmware blobs do not need fixing and should not be modified
|
|
|
|
dontFixup = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-08-06 21:57:35 +00:00
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p "$out/lib/firmware/brcm"
|
|
|
|
|
|
|
|
# Wifi firmware
|
2022-04-27 09:35:20 +00:00
|
|
|
cp -rv "$NIX_BUILD_TOP/firmware-nonfree/debian/config/brcm80211/." "$out/lib/firmware/"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Bluetooth firmware
|
2022-04-27 09:35:20 +00:00
|
|
|
cp -rv "$NIX_BUILD_TOP/bluez-firmware/broadcom/." "$out/lib/firmware/brcm"
|
|
|
|
|
|
|
|
# CM4 symlink must be added since it's missing from upstream
|
|
|
|
pushd $out/lib/firmware/brcm &>/dev/null
|
|
|
|
ln -s "./brcmfmac43455-sdio.txt" "$out/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt"
|
|
|
|
popd &>/dev/null
|
|
|
|
|
2021-08-06 21:57:35 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-12-29 15:07:52 +00:00
|
|
|
description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/RPi-Distro/firmware-nonfree";
|
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ lopsided98 ];
|
|
|
|
};
|
|
|
|
}
|