1{
2 lib,
3 fetchurl,
4 stdenvNoCC,
5 nix-update-script,
6}:
7
8stdenvNoCC.mkDerivation (finalAttrs: {
9 pname = "sof-firmware";
10 version = "2025.05";
11
12 src = fetchurl {
13 url = "https://github.com/thesofproject/sof-bin/releases/download/v${finalAttrs.version}/sof-bin-${finalAttrs.version}.tar.gz";
14 hash = "sha256-4vJgOw04x8vbFnKQGGP7+EtNtJIfQFlSojaRXLioa8w=";
15 };
16
17 dontFixup = true; # binaries must not be stripped or patchelfed
18
19 installPhase = ''
20 runHook preInstall
21
22 mkdir -p $out/lib/firmware/intel
23 # copy sof and sof-* recursively, preserving symlinks
24 cp -R -d sof{,-*} $out/lib/firmware/intel/
25
26 runHook postInstall
27 '';
28
29 passthru.updateScript = nix-update-script { };
30
31 meta = {
32 changelog = "https://github.com/thesofproject/sof-bin/releases/tag/v${finalAttrs.version}";
33 description = "Sound Open Firmware";
34 homepage = "https://www.sofproject.org/";
35 license = with lib.licenses; [
36 bsd3
37 isc
38 ];
39 maintainers = with lib.maintainers; [
40 lblasc
41 evenbrenden
42 hmenke
43 ];
44 platforms = with lib.platforms; linux;
45 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
46 };
47})