Skip to content

Commit

Permalink
nixos/pulseaudio: make daemon.conf configurable (#20888)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sternenseemann authored and Profpatsch committed Jan 14, 2017
1 parent 235da0d commit 9f56dd9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions nixos/modules/config/pulseaudio.nix
Expand Up @@ -160,6 +160,13 @@ in {
if activated.
'';
};

config = mkOption {
type = types.attrsOf types.unspecified;
default = {};
description = ''Config of the pulse daemon. See <literal>man pulse-daemon.conf</literal>.'';
example = literalExample ''{ flat-volumes = "no"; }'';
};
};

zeroconf = {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9f56dd9

Please sign in to comment.