From 0e045b23e59f0c43b28ffe2da46e1208bfcca395 Mon Sep 17 00:00:00 2001 From: Hleb Shauchenka Date: Sat, 29 Nov 2025 14:45:03 +0100 Subject: [PATCH] battery-toolkit: init at 1.8 --- pkgs/by-name/ba/battery-toolkit/package.nix | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pkgs/by-name/ba/battery-toolkit/package.nix diff --git a/pkgs/by-name/ba/battery-toolkit/package.nix b/pkgs/by-name/ba/battery-toolkit/package.nix new file mode 100644 index 000000000000..3c459bf76217 --- /dev/null +++ b/pkgs/by-name/ba/battery-toolkit/package.nix @@ -0,0 +1,39 @@ +{ + lib, + stdenvNoCC, + fetchzip, +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "battery-toolkit"; + version = "1.8"; + + src = fetchzip { + url = "https://github.com/mhaeuser/Battery-Toolkit/releases/download/${finalAttrs.version}/Battery-Toolkit-${finalAttrs.version}.zip"; + hash = "sha256-gsEXTE+pM+rsBhTeup7cWcUljY8u0T+ETON7JeA6g1A="; + stripRoot = false; + }; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/Applications" + cp -R "Battery Toolkit.app" "$out/Applications/" + + runHook postInstall + ''; + + meta = { + description = "Control the platform power state of your Apple Silicon Mac"; + longDescription = '' + Battery Toolkit allows you to control battery charging behavior on Apple Silicon Macs. + Features include setting upper and lower charge limits, disabling the power adapter, + and manual control over charging state. + ''; + homepage = "https://github.com/mhaeuser/Battery-Toolkit"; + changelog = "https://github.com/mhaeuser/Battery-Toolkit/releases/tag/${finalAttrs.version}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ shgew ]; + platforms = [ "aarch64-darwin" ]; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + }; +})