mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-09 03:18:50 +08:00
apple/t2: add Wi-Fi and Bluetooth firmware option
This commit is contained in:
42
apple/t2/pkgs/brcm-firmware/fetchmacos.nix
Normal file
42
apple/t2/pkgs/brcm-firmware/fetchmacos.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchFromGitHub,
|
||||
callPackage,
|
||||
dmg2img,
|
||||
}:
|
||||
|
||||
let
|
||||
macrecovery = callPackage ./macrecovery.nix { };
|
||||
in
|
||||
|
||||
{
|
||||
name,
|
||||
boardId,
|
||||
mlb,
|
||||
osType,
|
||||
hash,
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = name;
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
macrecovery
|
||||
dmg2img
|
||||
];
|
||||
buildPhase = ''
|
||||
macrecovery download -o . -b ${boardId} -m ${mlb} -os ${osType}
|
||||
dmg2img -s BaseSystem.dmg fw.img
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp fw.img $out
|
||||
'';
|
||||
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = hash;
|
||||
}
|
||||
Reference in New Issue
Block a user