2023-07-31 10:37:07 +03:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, Carbon
|
|
|
|
, Cocoa
|
2023-09-18 22:58:14 +03:00
|
|
|
, testers
|
2023-07-31 10:37:07 +03:00
|
|
|
}:
|
2018-03-05 21:29:35 +03:00
|
|
|
|
2023-07-31 10:37:07 +03:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "skhd";
|
2023-07-31 05:36:19 +03:00
|
|
|
version = "0.3.9";
|
2018-03-05 21:29:35 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "koekeishiya";
|
2023-07-31 10:37:07 +03:00
|
|
|
repo = "skhd";
|
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-fnkWws/g4BdHKDRhqoCpdPFUavOHdk8R7h7H1dAdAYI=";
|
2018-03-05 21:29:35 +03:00
|
|
|
};
|
|
|
|
|
2023-07-31 10:37:07 +03:00
|
|
|
buildInputs = [
|
|
|
|
Carbon
|
|
|
|
Cocoa
|
|
|
|
];
|
2018-03-05 21:29:35 +03:00
|
|
|
|
2023-07-31 10:37:07 +03:00
|
|
|
makeFlags = [
|
|
|
|
"BUILD_PATH=$(out)/bin"
|
|
|
|
];
|
2018-03-05 21:29:35 +03:00
|
|
|
|
2023-11-17 12:42:34 +03:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
|
|
|
|
|
2018-03-05 21:29:35 +03:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/Library/LaunchDaemons
|
|
|
|
cp ${./org.nixos.skhd.plist} $out/Library/LaunchDaemons/org.nixos.skhd.plist
|
|
|
|
substituteInPlace $out/Library/LaunchDaemons/org.nixos.skhd.plist --subst-var out
|
|
|
|
'';
|
|
|
|
|
2023-09-18 22:58:14 +03:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
version = "skhd-v${finalAttrs.version}";
|
|
|
|
};
|
|
|
|
|
2023-07-31 10:37:07 +03:00
|
|
|
meta = {
|
2018-03-05 21:29:35 +03:00
|
|
|
description = "Simple hotkey daemon for macOS";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://github.com/koekeishiya/skhd";
|
2023-07-31 10:37:07 +03:00
|
|
|
license = lib.licenses.mit;
|
2023-08-26 15:03:52 +03:00
|
|
|
mainProgram = "skhd";
|
|
|
|
maintainers = with lib.maintainers; [ cmacrae lnl7 periklis khaneliman ];
|
2023-07-31 10:37:07 +03:00
|
|
|
platforms = lib.platforms.darwin;
|
2018-03-05 21:29:35 +03:00
|
|
|
};
|
2023-07-31 10:37:07 +03:00
|
|
|
})
|