diff --git a/nixos/modules/config/pulseaudio.nix b/nixos/modules/config/pulseaudio.nix index 742167fbf69f..d5cb4fce0f9d 100644 --- a/nixos/modules/config/pulseaudio.nix +++ b/nixos/modules/config/pulseaudio.nix @@ -160,6 +160,13 @@ in { if activated. ''; }; + + config = mkOption { + type = types.attrsOf types.unspecified; + default = {}; + description = ''Config of the pulse daemon. See man pulse-daemon.conf.''; + example = literalExample ''{ flat-volumes = "no"; }''; + }; }; zeroconf = { @@ -204,10 +211,13 @@ in { (mkIf cfg.enable { environment.systemPackages = [ overriddenPackage ]; - environment.etc = singleton { - target = "asound.conf"; - source = alsaConf; - }; + environment.etc = [ + { target = "asound.conf"; + source = alsaConf; } + + { target = "pulse/daemon.conf"; + source = writeText "daemon.conf" (lib.generators.toKeyValue {} cfg.daemon.config); } + ]; # Allow PulseAudio to get realtime priority using rtkit. security.rtkit.enable = true;