7 stdenvNoCC.mkDerivation (finalAttrs: {
12 url = "https://github.com/davidwernhart/aldente-charge-limiter/releases/download/${finalAttrs.version}/AlDente.dmg";
13 hash = "sha256-pSqBDDumCbORLQ+B3skSqKmgG2KybR5Zb4ojiNQcAaM=";
19 nativeBuildInputs = [ undmg ];
21 # AlDente.dmg is not HFS formatted, default unpackPhase fails
22 # https://discourse.nixos.org/t/help-with-error-only-hfs-file-systems-are-supported-on-ventura
24 if ! [[ "$curSrc" =~ \.dmg$ ]]; then return 1; fi
25 mnt=$(mktemp -d -t ci-XXXXXXXXXX)
28 /usr/bin/hdiutil detach $mnt -force
32 /usr/bin/hdiutil attach -nobrowse -readonly $src -mountpoint $mnt
36 (cd "$mnt"; cp -a !(Applications) "$DEST/")
39 sourceRoot = "AlDente.app";
44 mkdir -p $out/Applications/AlDente.app
45 cp -R . $out/Applications/AlDente.app
51 description = "macOS tool to limit maximum charging percentage";
52 homepage = "https://apphousekitchen.com";
53 changelog = "https://github.com/davidwernhart/aldente-charge-limiter/releases/tag/${finalAttrs.version}";
54 license = with licenses; [ unfree ];
55 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
56 maintainers = with maintainers; [ stepbrobd ];
57 platforms = [ "aarch64-darwin" "x86_64-darwin" ];