Add hammerspoon
This commit is contained in:
parent
fd85753fcf
commit
e0956a2c52
12
flake.nix
12
flake.nix
@ -29,6 +29,11 @@
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
# Add overlay for custom packages
|
||||
overlay = final: prev: {
|
||||
hammerspoon = final.callPackage ./modules/hammerspoon.nix { };
|
||||
};
|
||||
in
|
||||
{
|
||||
lib = {
|
||||
@ -85,6 +90,13 @@
|
||||
self = self;
|
||||
};
|
||||
modules = [
|
||||
# Add our overlay to the system configuration
|
||||
(
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
nixpkgs.overlays = [ overlay ];
|
||||
}
|
||||
)
|
||||
mac-app-util.darwinModules.default
|
||||
./darwin/common.nix
|
||||
./darwin/lcech-mac-veracode.nix
|
||||
|
||||
@ -18,6 +18,7 @@ in
|
||||
|
||||
home.packages = with pkgs; [
|
||||
awscli2
|
||||
hammerspoon
|
||||
k9s
|
||||
kubectl
|
||||
nixd
|
||||
@ -35,6 +36,11 @@ in
|
||||
window-height = 9999
|
||||
'';
|
||||
};
|
||||
"${homedir}/.hammerspoon/init.lua" = {
|
||||
text = ''
|
||||
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
programs.direnv = {
|
||||
|
||||
41
modules/hammerspoon.nix
Normal file
41
modules/hammerspoon.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
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 = "1.0.0";
|
||||
|
||||
# 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-XbcCtV2kfcMG6PWUjZHvhb69MV3fopQoMioK9+1+an4=";
|
||||
};
|
||||
|
||||
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"
|
||||
];
|
||||
};
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user