2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, Carbon, Cocoa }:
|
2017-01-24 08:31:11 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "khd";
|
2018-03-02 19:45:38 +01:00
|
|
|
version = "3.0.0";
|
2017-01-24 08:31:11 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "koekeishiya";
|
|
|
|
repo = "khd";
|
|
|
|
rev = "v${version}";
|
2018-03-02 19:45:38 +01:00
|
|
|
sha256 = "0nzfhknv1s71870w2dk9dy56a3g5zsbjphmfrz0vsvi438g099r4";
|
2017-01-24 08:31:11 +01:00
|
|
|
};
|
|
|
|
|
2018-03-02 19:45:38 +01:00
|
|
|
patches = [
|
|
|
|
# Fixes build issues, remove with >3.0.0
|
|
|
|
(fetchpatch {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "https://github.com/koekeishiya/khd/commit/4765ae0b4c7d4ca56319dc92ff54393cd9e03fbc.patch";
|
2018-03-02 19:45:38 +01:00
|
|
|
sha256 = "0kvf5hxi5bf6pf125qib7wn7hys0ag66zzpp4srj1qa87lxyf7np";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-01-24 08:31:11 +01:00
|
|
|
buildInputs = [ Carbon Cocoa ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make install
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/khd $out/bin/khd
|
|
|
|
|
|
|
|
mkdir -p $out/Library/LaunchDaemons
|
|
|
|
cp ${./org.nixos.khd.plist} $out/Library/LaunchDaemons/org.nixos.khd.plist
|
|
|
|
substituteInPlace $out/Library/LaunchDaemons/org.nixos.khd.plist --subst-var out
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-03-04 18:00:58 +01:00
|
|
|
description = "A simple modal hotkey daemon for OSX";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/koekeishiya/khd";
|
|
|
|
downloadPage = "https://github.com/koekeishiya/khd/releases";
|
2017-01-24 08:31:11 +01:00
|
|
|
platforms = platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ lnl7 ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|