diff --git a/modules/nixos/pipewire.nix b/modules/nixos/pipewire.nix index 7e90ffe..31fef42 100644 --- a/modules/nixos/pipewire.nix +++ b/modules/nixos/pipewire.nix @@ -19,6 +19,27 @@ in jack.enable = true; }; + # Re-enable PulseAudio-style auto profile switching (ACP), since + # WirePlumber 0.5 disables it and never reacts to HDMI hotplug events, + # leaving audio stuck on analog when a dock/TV is connected. + services.pipewire.wireplumber.extraConfig."99-acp-auto-profile" = { + "monitor.alsa.rules" = [ + { + matches = [ + { + "device.name" = "~alsa_card.*"; + } + ]; + actions = { + update-props = { + "api.acp.auto-profile" = true; + "api.acp.auto-port" = true; + }; + }; + } + ]; + }; + # Allows Pipewire to use the realtime scheduler for increased performance security.rtkit.enable = true; };