From 057beb27e28ef402fc4a7f8a825a9b857de365e8 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 30 Apr 2025 15:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=A3=B0=E9=9F=B3=E4=BC=91?= =?UTF-8?q?=E7=9C=A0=EF=BC=8C=E9=81=BF=E5=85=8D=E6=92=AD=E6=94=BE=E5=90=8E?= =?UTF-8?q?n=E7=A7=92=E6=89=8D=E5=87=BA=E7=8E=B0=E5=A3=B0=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/nixos/audio.nix | 63 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 7 deletions(-) diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix index 9141e14..72f18ad 100644 --- a/modules/nixos/audio.nix +++ b/modules/nixos/audio.nix @@ -8,18 +8,67 @@ # If you want to use JACK applications, uncomment this #jack.enable = true; - wireplumber.extraConfig.bluetoothEnhancements = { - "monitor.bluez.properties" = { - "bluez5.enable-sbc-xq" = true; - "bluez5.enable-msbc" = true; - "bluez5.enable-hw-volume" = true; - "bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ]; + wireplumber = { + enable = true; + extraConfig = { + "80-bluetooth-enhancements" = { + "monitor.bluez.properties" = { + "bluez5.enable-sbc-xq" = true; + "bluez5.enable-msbc" = true; + "bluez5.enable-hw-volume" = true; + "bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ]; + }; + }; + # Disable suspend for all ALSA nodes + "99-disable-suspend" = { + # ALSA Rules: Separate rule for input and output + "monitor.alsa.rules" = [ + # Rule for ALSA outputs + { + matches = [ + { + # Matches all sinks (outputs) + "node.name" = "~alsa_output.*"; + } + { + # Matches all sources (inputs) + "node.name" = "~alsa_input.*"; + } + ]; + actions = { + "update-props" = { + "session.suspend-timeout-seconds" = 0; + }; + }; + } + ]; + + # Bluez Rules: Separate rule for input and output + "monitor.bluez.rules" = [ + # Rule for Bluez outputs + { + matches = [ + { + "node.name" = "~bluez_output.*"; + } + { + "node.name" = "~bluez_input.*"; + } + ]; + actions = { + "update-props" = { + "session.suspend-timeout-seconds" = 0; + }; + }; + } + ]; + }; }; }; }; }; - environment.systemPackages = with pkgs;[ + environment.systemPackages = with pkgs; [ # audio control software pamixer ];