Created
February 4, 2024 23:38
-
-
Save Qyriad/a81f644c0199076577726983bd7f533a to your computer and use it in GitHub Desktop.
Hammerspoon package definition for Nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
lib, | |
stdenvNoCC, | |
fetchurl, | |
unzip, | |
}: | |
# This cannot be built from source since Hammerspoon requires entitlements to work, | |
# and codesigning entitlements is unfortunately incompatible with immutability. | |
stdenvNoCC.mkDerivation (self: { | |
pname = "hammerspoon"; | |
version = "0.9.100"; | |
# We don't use fetchzip because that seems to unpack the .app as well. | |
src = fetchurl { | |
name = "${self.pname}-${self.version}-source.zip"; | |
url = "https://github.com/Hammerspoon/hammerspoon/releases/download/${self.version}/Hammerspoon-${self.version}.zip"; | |
sha256 = "sha256-bc/IB8fOxpLK87GMNsweo69rn0Jpm03yd3NECOTgc5k="; | |
}; | |
nativeBuildInputs = [ | |
# Adds unpack hook. | |
unzip | |
]; | |
installPhase = '' | |
runHook preInstall | |
mkdir -p $out/Applications | |
cp -r ../Hammerspoon.app $out/Applications/ | |
runHook postInstall | |
''; | |
meta = { | |
homepage = "https://www.hammerspoon.org"; | |
description = "Staggeringly powerful macOS desktop automation with Lua"; | |
license = lib.licenses.mit; | |
platforms = [ "x86_64-darwin" "aarch64-darwin" ]; | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Much appreciated for the share.