summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-02-06 22:10:40 +0300
committerNikolay Amiantov <ab@fmap.me>2016-02-06 22:10:40 +0300
commitb16b5bcaa344d07e99b676a905e2e617ac16afdb (patch)
tree720eb9ea82d97615a8f5a97c9125dc2f26749ae9 /nixos
parent008acbc506039ab87f2deb02a2cd00254d64a260 (diff)
parentae662cdb11cb011aa5fbbf99771927988c379bd2 (diff)
downloadnixlib-b16b5bcaa344d07e99b676a905e2e617ac16afdb.tar
nixlib-b16b5bcaa344d07e99b676a905e2e617ac16afdb.tar.gz
nixlib-b16b5bcaa344d07e99b676a905e2e617ac16afdb.tar.bz2
nixlib-b16b5bcaa344d07e99b676a905e2e617ac16afdb.tar.lz
nixlib-b16b5bcaa344d07e99b676a905e2e617ac16afdb.tar.xz
nixlib-b16b5bcaa344d07e99b676a905e2e617ac16afdb.tar.zst
nixlib-b16b5bcaa344d07e99b676a905e2e617ac16afdb.zip
Merge pull request #12811 from abbradar/pulseaudio-device-manager
Load PulseAudio's module-device-manager only for KDE
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde4.nix6
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde5.nix10
-rw-r--r--nixos/modules/services/x11/display-managers/default.nix3
3 files changed, 15 insertions, 4 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/kde4.nix b/nixos/modules/services/x11/desktop-managers/kde4.nix
index 29cca248cde3..80e408be4923 100644
--- a/nixos/modules/services/x11/desktop-managers/kde4.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde4.nix
@@ -108,6 +108,12 @@ in
                 sed -e '/nix\\store\|nix\/store/ d' -i $HOME/.config/Trolltech.conf
             fi
 
+            # Load PulseAudio module for routing support.
+            # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
+            ${optionalString config.hardware.pulseaudio.enable ''
+              ${config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
+            ''}
+
             # Start KDE.
             exec ${kde_workspace}/bin/startkde
           '';
diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix
index e8c768e41fad..713a156d35ab 100644
--- a/nixos/modules/services/x11/desktop-managers/kde5.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde5.nix
@@ -55,7 +55,15 @@ in
     services.xserver.desktopManager.session = singleton {
       name = "kde5";
       bgSupport = true;
-      start = ''exec ${kde5.plasma-workspace}/bin/startkde;'';
+      start = ''
+        # Load PulseAudio module for routing support.
+        # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
+        ${optionalString config.hardware.pulseaudio.enable ''
+          ${config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
+        ''}
+
+        exec ${kde5.plasma-workspace}/bin/startkde
+      '';
     };
 
     security.setuidOwners = singleton {
diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix
index bad99ccd8696..87f3a4837a69 100644
--- a/nixos/modules/services/x11/display-managers/default.nix
+++ b/nixos/modules/services/x11/display-managers/default.nix
@@ -90,9 +90,6 @@ let
 
         # Publish access credentials in the root window.
         ${config.hardware.pulseaudio.package}/bin/pactl load-module module-x11-publish "display=$DISPLAY"
-
-        # Keep track of devices.  Mostly useful for Phonon/KDE.
-        ${config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
       ''}
 
       # Tell systemd about our $DISPLAY. This is needed by the