From adfb7e1f13c3129262551c4cee1912962bafdd2c Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 24 Jan 2017 08:31:11 +0100 Subject: [PATCH] kwm: init at 1.1.4 --- pkgs/os-specific/darwin/khd/default.nix | 42 +++++++++++++++++++ .../darwin/khd/org.nixos.khd.plist | 33 +++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 3 files changed, 79 insertions(+) create mode 100644 pkgs/os-specific/darwin/khd/default.nix create mode 100644 pkgs/os-specific/darwin/khd/org.nixos.khd.plist diff --git a/pkgs/os-specific/darwin/khd/default.nix b/pkgs/os-specific/darwin/khd/default.nix new file mode 100644 index 000000000000..f08073a8901e --- /dev/null +++ b/pkgs/os-specific/darwin/khd/default.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchFromGitHub, Carbon, Cocoa }: + +stdenv.mkDerivation rec { + name = "khd-${version}"; + version = "1.1.4"; + + src = fetchFromGitHub { + owner = "koekeishiya"; + repo = "khd"; + rev = "v${version}"; + sha256 = "1klia3fywl0c88zbp5wdn6kxhdwdry1jwmkj27vpv8vzvdfzwfmy"; + }; + + buildInputs = [ Carbon Cocoa ]; + + prePatch = '' + substituteInPlace makefile \ + --replace g++ clang++ + ''; + + 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 + ''; + + meta = with stdenv.lib; { + description = "A simple modal hototkey daemon for OSX"; + homepage = https://github.com/koekeishiya/khd; + downloadPage = https://github.com/koekeishiya/khd/releases; + platforms = platforms.darwin; + maintainers = with maintainers; [ lnl7 ]; + license = licenses.mit; + }; +} diff --git a/pkgs/os-specific/darwin/khd/org.nixos.khd.plist b/pkgs/os-specific/darwin/khd/org.nixos.khd.plist new file mode 100644 index 000000000000..3c0aaa81eb61 --- /dev/null +++ b/pkgs/os-specific/darwin/khd/org.nixos.khd.plist @@ -0,0 +1,33 @@ + + + + + Label + org.nixos.khd + ProgramArguments + + @out@/bin/khd + + KeepAlive + + ProcessType + Interactive + EnvironmentVariables + + PATH + @out@/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin + + Sockets + + Listeners + + SockServiceName + 3021 + SockType + dgram + SockFamily + IPv4 + + + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 944f9c9d2258..84ea9ddb87aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -524,6 +524,10 @@ in oracle-instantclient = callPackage ../development/libraries/oracle-instantclient { }; + khd = callPackage ../os-specific/darwin/khd { + inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; + }; + reattach-to-user-namespace = callPackage ../os-specific/darwin/reattach-to-user-namespace {}; install_name_tool = callPackage ../os-specific/darwin/install_name_tool { };