From b84d22cbbd79af695f0829f966d97b76400791fa Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 5 Mar 2018 19:29:35 +0100 Subject: [PATCH] skhd: init at 0.0.10 --- pkgs/os-specific/darwin/skhd/default.nix | 34 +++++++++++++++++++ .../darwin/skhd/org.nixos.skhd.plist | 23 +++++++++++++ pkgs/top-level/all-packages.nix | 6 +++- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/darwin/skhd/default.nix create mode 100644 pkgs/os-specific/darwin/skhd/org.nixos.skhd.plist diff --git a/pkgs/os-specific/darwin/skhd/default.nix b/pkgs/os-specific/darwin/skhd/default.nix new file mode 100644 index 000000000000..aa97a36e691e --- /dev/null +++ b/pkgs/os-specific/darwin/skhd/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchFromGitHub, Carbon }: + +stdenv.mkDerivation rec { + name = "skhd-${version}"; + version = "0.0.10"; + + src = fetchFromGitHub { + owner = "koekeishiya"; + repo = "skhd"; + rev = "v${version}"; + sha256 = "0a0r8z9bvb1pzqag7nqa84xm99n0xvg27cw11qcv65snr06bqc9w"; + }; + + buildInputs = [ Carbon ]; + + makeFlags = [ "BUILD_PATH=$(out)/bin" ]; + + 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 + ''; + + # See https://github.com/koekeishiya/skhd/issues/28 + hardeningDisable = [ "all" ]; + + meta = with stdenv.lib; { + description = "Simple hotkey daemon for macOS"; + homepage = https://github.com/koekeishiya/skhd; + platforms = platforms.darwin; + maintainers = with maintainers; [ lnl7 ]; + license = licenses.mit; + }; +} diff --git a/pkgs/os-specific/darwin/skhd/org.nixos.skhd.plist b/pkgs/os-specific/darwin/skhd/org.nixos.skhd.plist new file mode 100644 index 000000000000..e6624487740b --- /dev/null +++ b/pkgs/os-specific/darwin/skhd/org.nixos.skhd.plist @@ -0,0 +1,23 @@ + + + + + Label + org.nixos.skhd + ProgramArguments + + @out@/bin/skhd + + ProcessType + Interactive + EnvironmentVariables + + PATH + @out@/bin:/nix/var/nix/profiles/default/bin:/usr/bin:/bin:/usr/sbin:/sbin + + RunAtLoad + + KeepAlive + + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f54b163c1305..3769960fa728 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -676,6 +676,10 @@ with pkgs; reattach-to-user-namespace = callPackage ../os-specific/darwin/reattach-to-user-namespace {}; + skhd = callPackage ../os-specific/darwin/skhd { + inherit (darwin.apple_sdk.frameworks) Carbon; + }; + qes = callPackage ../os-specific/darwin/qes { inherit (darwin.apple_sdk.frameworks) Carbon; }; @@ -10440,7 +10444,7 @@ with pkgs; ## libGL/libGLU/Mesa stuff # Default libGL implementation, should provide headers and libGL.so/libEGL.so/... to link agains them - # Default implementation is `mesa`, but can be eventually replaced with `libglvnd`, + # Default implementation is `mesa`, but can be eventually replaced with `libglvnd`, # or other runtime dispatcher libGL = mesa_noglu;