From 412ca0ba40df8bed1c4a27afe08b8d0cb2043396 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Tue, 3 Sep 2024 17:38:02 +0800 Subject: [PATCH] feat: package `get-apple-firmware` script --- nix/common.nix | 1 + nix/pkgs/firmware-script.nix | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 nix/pkgs/firmware-script.nix diff --git a/nix/common.nix b/nix/common.nix index 6d2df0c..8ddfa41 100644 --- a/nix/common.nix +++ b/nix/common.nix @@ -21,6 +21,7 @@ git python3 dmg2img + (pkgs.callPackage ./pkgs/firmware-script.nix {}) ]; # ZFS is (sometimes) broken and prevents building without this diff --git a/nix/pkgs/firmware-script.nix b/nix/pkgs/firmware-script.nix new file mode 100644 index 0000000..64a07b4 --- /dev/null +++ b/nix/pkgs/firmware-script.nix @@ -0,0 +1,24 @@ +{ stdenvNoCC, fetchurl, lib }: stdenvNoCC.mkDerivation (final: { + pname = "get-apple-firmware"; + version = "fe8c338e6cf1238a390984ba06544833ab8792d3"; + src = fetchurl { + url = "https://raw.github.com/t2linux/wiki/${final.version}/docs/tools/firmware.sh"; + hash = "sha256-DYghvLnG3DO8WmLIrT4p5yzCDWRevp3vx0wYtdTLyeY="; + }; + + dontUnpack = true; + + buildPhase = '' + mkdir -p $out/bin + cp ${final.src} $out/bin/get-apple-firmware + chmod +x $out/bin/get-apple-firmware + ''; + + meta = { + description = "A script to get needed firmware for T2linux devices"; + homepage = "https://t2linux.org"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ soopyc ]; + mainProgram = "get-apple-firmware"; + }; +})