From a66d5b19c4f3d22ea4d0b3963074656abad0389c Mon Sep 17 00:00:00 2001 From: _cry64 Date: Sat, 28 Mar 2026 00:35:49 +1000 Subject: [PATCH] too drunk rn idk --- .../core/t2-firmware/brcm-firmware.nix | 25 +++++++++++++++++++ hosts/modules/core/t2-firmware/default.nix | 6 ++++- .../core/t2-firmware/get-apple-firmware.nix | 9 +++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 hosts/modules/core/t2-firmware/brcm-firmware.nix diff --git a/hosts/modules/core/t2-firmware/brcm-firmware.nix b/hosts/modules/core/t2-firmware/brcm-firmware.nix new file mode 100644 index 0000000..db6584c --- /dev/null +++ b/hosts/modules/core/t2-firmware/brcm-firmware.nix @@ -0,0 +1,25 @@ +{ + stdenvNoCC, + get-apple-firmware, +}: +stdenvNoCC.mkDerivation (final: { + name = "brcm-firmware"; + src = ./firmware/brcm; + + installPhase = '' + mkdir -p $out/lib/firmware/brcm + cp ${final.src}/* "$out/lib/firmware/brcm" + ''; + + buildInputs = [ + get-apple-firmware + ]; + + buildPhase = '' + mkdir -p $out/bin + cp ${final.src} $out/bin/get-apple-firmware + chmod +x $out/bin/get-apple-firmware + + mkdir + ''; +}) diff --git a/hosts/modules/core/t2-firmware/default.nix b/hosts/modules/core/t2-firmware/default.nix index e1655f7..9691719 100644 --- a/hosts/modules/core/t2-firmware/default.nix +++ b/hosts/modules/core/t2-firmware/default.nix @@ -1,7 +1,6 @@ # REF: https://github.com/t2linux/nixos-t2-iso { inputs, - pkgs, t2pkgs, ... } @ args: { @@ -28,10 +27,15 @@ overlays = [ (self: super: { get-apple-firmware = super.callPackage ./get-apple-firmware.nix {}; + brcm-firmware = super.callPackage ./brcm-firmware.nix {}; }) ]; }; + hardware.firmware = [ + t2pkgs.brcm-firmware + ]; + # environment.systemPackages = with base; [ # python3 # dmg2img diff --git a/hosts/modules/core/t2-firmware/get-apple-firmware.nix b/hosts/modules/core/t2-firmware/get-apple-firmware.nix index 7b25cce..ceb952a 100644 --- a/hosts/modules/core/t2-firmware/get-apple-firmware.nix +++ b/hosts/modules/core/t2-firmware/get-apple-firmware.nix @@ -2,6 +2,9 @@ stdenvNoCC, fetchurl, lib, + python3, + dmg2img, + curl, }: stdenvNoCC.mkDerivation (final: { pname = "get-apple-firmware"; @@ -13,6 +16,12 @@ stdenvNoCC.mkDerivation (final: { dontUnpack = true; + buildInputs = [ + curl + dmg2img + python3 + ]; + buildPhase = '' mkdir -p $out/bin cp ${final.src} $out/bin/get-apple-firmware