From 52d385c37a6792aa5a91184dad896225e927df74 Mon Sep 17 00:00:00 2001 From: Craig Furman Date: Mon, 28 Apr 2025 19:20:52 +0100 Subject: [PATCH] bluesnooze: init at 1.2 --- pkgs/by-name/bl/bluesnooze/package.nix | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pkgs/by-name/bl/bluesnooze/package.nix diff --git a/pkgs/by-name/bl/bluesnooze/package.nix b/pkgs/by-name/bl/bluesnooze/package.nix new file mode 100644 index 000000000000..7fa0017646c4 --- /dev/null +++ b/pkgs/by-name/bl/bluesnooze/package.nix @@ -0,0 +1,40 @@ +{ + fetchurl, + lib, + stdenv, + unzip, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "bluesnooze"; + version = "1.2"; + src = fetchurl { + url = "https://github.com/odlp/bluesnooze/releases/download/v${finalAttrs.version}/Bluesnooze.zip"; + hash = "sha256-B1qLfPj2bU9AAsYqGYWl0/sEPj3wnn/UBeiM4kqW/rA="; + }; + + # Needed to avoid the binary becoming corrupted and mac refusing to open it. I + # don't know why. + dontFixup = true; + + # "unpack" phase does the unzipping automatically + nativeBuildInputs = [ unzip ]; + sourceRoot = "."; # squash "unpacker produced multiple directories" error + + installPhase = '' + runHook preInstall + + mkdir -p "$out/Applications" + cp -r Bluesnooze.app $out/Applications/ + + runHook postInstall + ''; + + meta = { + description = "Bluesnooze prevents your sleeping Mac from connecting to Bluetooth accessories"; + homepage = "https://github.com/odlp/bluesnooze"; + changelog = "https://github.com/odlp/bluesnooze/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ craigf ]; + platforms = lib.platforms.darwin; + }; +})