From 9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 14 Jan 2017 22:58:16 +0100 Subject: nixos/pulseaudio: make daemon.conf configurable (#20888) This adds pulseaudio.daemon.config, which is a set of keys to values which are directly translated to keys and values of pulseaudio's daemon.conf, e. g. hardware.pulseaudio.daemon.config = { flat-volumes = "no"; } becomes flat-volumes=no in pulse/daemon.conf. --- nixos/modules/config/pulseaudio.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/config/pulseaudio.nix b/nixos/modules/config/pulseaudio.nix index 742167fbf69..d5cb4fce0f9 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; -- cgit 1.4.1