From ca1cddd15b366dc0cac086016e3e4533b89b88aa Mon Sep 17 00:00:00 2001 From: Ryan Horiguchi Date: Wed, 12 Jan 2022 02:14:11 +0100 Subject: [PATCH] gnomeExtensions.volume-mixer: add override to fix extension --- .../gnome/extensions/extensionOverrides.nix | 17 +++++++++- ...shell-volume-mixer_at_derhofbauer.at.patch | 32 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 pkgs/desktops/gnome/extensions/extensionOverridesPatches/shell-volume-mixer_at_derhofbauer.at.patch diff --git a/pkgs/desktops/gnome/extensions/extensionOverrides.nix b/pkgs/desktops/gnome/extensions/extensionOverrides.nix index b431e7da4427..da95f3244095 100644 --- a/pkgs/desktops/gnome/extensions/extensionOverrides.nix +++ b/pkgs/desktops/gnome/extensions/extensionOverrides.nix @@ -3,10 +3,13 @@ , gjs , gnome , gobject-introspection -, xprop +, pulseaudio +, python3 +, substituteAll , touchegg , vte , wrapGAppsHook +, xprop }: let # Helper method to reduce redundancy @@ -62,6 +65,18 @@ super: lib.trivial.pipe super [ ''; })) + (patchExtension "shell-volume-mixer@derhofbauer.at" (old: { + patches = [ + (substituteAll { + src = ./extensionOverridesPatches/shell-volume-mixer_at_derhofbauer.at.patch; + inherit pulseaudio; + inherit python3; + }) + ]; + + meta.maintainers = with lib.maintainers; [ rhoriguchi ]; + })) + (patchExtension "unite@hardpixel.eu" (old: { buildInputs = [ xprop ]; diff --git a/pkgs/desktops/gnome/extensions/extensionOverridesPatches/shell-volume-mixer_at_derhofbauer.at.patch b/pkgs/desktops/gnome/extensions/extensionOverridesPatches/shell-volume-mixer_at_derhofbauer.at.patch new file mode 100644 index 000000000000..f1064feb54b8 --- /dev/null +++ b/pkgs/desktops/gnome/extensions/extensionOverridesPatches/shell-volume-mixer_at_derhofbauer.at.patch @@ -0,0 +1,32 @@ +diff --git a/lib/utils/paHelper.js b/lib/utils/paHelper.js +index be28d21..a410a63 100755 +--- a/lib/utils/paHelper.js ++++ b/lib/utils/paHelper.js +@@ -57,13 +57,7 @@ async function execHelper(type, index = undefined) { + return null; + } + +- const python = await findPython(); +- +- if (!python) { +- return null; +- } +- +- const args = ['/usr/bin/env', python, paUtilPath, type]; ++ const args = ['@python3@/bin/python', paUtilPath, type]; + + if (!isNaN(index)) { + args.push(index); +diff --git a/pautils/lib/libpulse.py b/pautils/lib/libpulse.py +index a32c272..8225f2f 100755 +--- a/pautils/lib/libpulse.py ++++ b/pautils/lib/libpulse.py +@@ -16,7 +16,7 @@ + from ctypes import * + + try: +- lib = CDLL('libpulse.so.0') ++ lib = CDLL('@pulseaudio@/lib/libpulse.so.0') + except: + lib = CDLL('libpulse.so') +