From 9ffd88ed2699016b9c52e91fbe896d3bf72a2498 Mon Sep 17 00:00:00 2001 From: traxys Date: Sun, 14 Apr 2024 00:17:12 +0200 Subject: [PATCH] pkgs: Add push-to-talk fix --- pkgs/default.nix | 1 + pkgs/push-to-talk.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 pkgs/push-to-talk.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 0e35fd1..32933a4 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -17,4 +17,5 @@ perseus-cli = callPackage ./perseus {inherit bonnie;}; flex-launcher = callPackage ./flex-launcher.nix {}; mesonlsp = callPackage ./mesonlsp {}; + push-to-talk = callPackage ./push-to-talk.nix {}; } diff --git a/pkgs/push-to-talk.nix b/pkgs/push-to-talk.nix new file mode 100644 index 0000000..5987f33 --- /dev/null +++ b/pkgs/push-to-talk.nix @@ -0,0 +1,41 @@ +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + libevdev, + xdotool, + xorg, +}: +stdenv.mkDerivation { + pname = "wayland-push-to-talk-fix"; + version = "unstable-2023-12-19"; + + src = fetchFromGitHub { + owner = "Rush"; + repo = "wayland-push-to-talk-fix"; + rev = "490f43054453871fe18e7d7e9041cfbd0f1d9b7d"; + hash = "sha256-ZRSgrQHnNdEF2PyaflmI5sUoKCxtZ0mQY/bb/9PH64c="; + }; + + nativeBuildInputs = [pkg-config]; + buildInputs = [libevdev xdotool xorg.libX11.dev]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + install -m 755 push-to-talk $out/bin + + runHook postInstall + ''; + + meta = with lib; { + description = "This fixes the inability to use push to talk in Discord when running Wayland"; + homepage = "https://github.com/Rush/wayland-push-to-talk-fix"; + license = licenses.mit; + maintainers = with maintainers; [traxys]; + mainProgram = "wayland-push-to-talk-fix"; + platforms = platforms.all; + }; +}