diff --git a/pkgs/os-specific/darwin/kwm/default.nix b/pkgs/os-specific/darwin/kwm/default.nix new file mode 100644 index 000000000000..ac231f2dfe3d --- /dev/null +++ b/pkgs/os-specific/darwin/kwm/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchzip }: + +stdenv.mkDerivation rec { + name = "kwm-${version}"; + version = "4.0.4"; + + src = fetchzip { + stripRoot = false; + url = "https://github.com/koekeishiya/kwm/releases/download/v${version}/Kwm-${version}.zip"; + sha256 = "07rf4ichq511w8qmvd6s602s7xcyjhjp73d5c615sj82cxvgirwc"; + }; + + # TODO: Build this properly once we have swiftc. + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp kwmc $out/bin/kwmc + cp kwm overlaylib.dylib $out + + mkdir -p $out/Library/LaunchDaemons + cp ${./org.nixos.kwm.plist} $out/Library/LaunchDaemons/org.nixos.kwm.plist + substituteInPlace $out/Library/LaunchDaemons/org.nixos.kwm.plist --subst-var out + ''; + + meta = with stdenv.lib; { + description = "Tiling window manager with focus follows mouse for OSX"; + homepage = https://github.com/koekeishiya/kwm; + downloadPage = https://github.com/koekeishiya/kwm/releases; + platforms = platforms.darwin; + maintainers = with maintainers; [ lnl7 ]; + license = licenses.mit; + }; +} diff --git a/pkgs/os-specific/darwin/kwm/org.nixos.kwm.plist b/pkgs/os-specific/darwin/kwm/org.nixos.kwm.plist new file mode 100644 index 000000000000..eafce2ab4a46 --- /dev/null +++ b/pkgs/os-specific/darwin/kwm/org.nixos.kwm.plist @@ -0,0 +1,26 @@ + + + + + Label + org.nixos.kwm + ProgramArguments + + @out@/kwm + + KeepAlive + + Sockets + + Listeners + + SockServiceName + 3020 + SockType + dgram + SockFamily + IPv4 + + + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 120ec3ccd803..8e7bb79858f0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -524,6 +524,8 @@ in oracle-instantclient = callPackage ../development/libraries/oracle-instantclient { }; + kwm = callPackage ../os-specific/darwin/kwm { }; + khd = callPackage ../os-specific/darwin/khd { inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; };