summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorsternenseemann <git@lukasepple.de>2017-01-14 22:58:16 +0100
committerProfpatsch <mail@profpatsch.de>2017-01-14 22:58:16 +0100
commit9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c (patch)
treed2efbc3fcdc885c7c488d5940d0cd64acb0169be /nixos
parent235da0d77bdafa0b2e5a3b439358270b033a38c1 (diff)
downloadnixpkgs-9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c.tar
nixpkgs-9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c.tar.gz
nixpkgs-9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c.tar.bz2
nixpkgs-9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c.tar.lz
nixpkgs-9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c.tar.xz
nixpkgs-9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c.tar.zst
nixpkgs-9f56dd9d63a4636b540fd99f2e7ecd28fcd9783c.zip
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.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/pulseaudio.nix18
1 files changed, 14 insertions, 4 deletions
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 <literal>man pulse-daemon.conf</literal>.'';
+          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;