summary refs log tree commit diff
path: root/nixos/modules/services/desktops
diff options
context:
space:
mode:
authorJan Solanti <jhs@psonet.com>2020-11-22 04:42:02 +0200
committerJan Solanti <jhs@psonet.com>2020-11-23 10:40:35 +0200
commitaca97840da9a85ddf65ea33fa778a35d8d88bb4b (patch)
treecc09351a3060f11ac9bb83e9946400addce6a356 /nixos/modules/services/desktops
parent258903e725db91db53f0ed8badfad8b988ba0e05 (diff)
downloadnixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.gz
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.bz2
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.lz
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.xz
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.zst
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.zip
pipewire: 0.3.15 -> 0.3.16
This release replaces the libpulseaudio shim with a pipewire module that acts as a fake pulseaudio server along with a systemd service that loads that module on demand.
Diffstat (limited to 'nixos/modules/services/desktops')
-rw-r--r--nixos/modules/services/desktops/pipewire.nix19
1 files changed, 8 insertions, 11 deletions
diff --git a/nixos/modules/services/desktops/pipewire.nix b/nixos/modules/services/desktops/pipewire.nix
index 5179cbaf6bc..c4923cfd3f0 100644
--- a/nixos/modules/services/desktops/pipewire.nix
+++ b/nixos/modules/services/desktops/pipewire.nix
@@ -17,10 +17,6 @@ let
     mkdir -p "$out/lib"
     ln -s "${pkgs.pipewire.jack}/lib" "$out/lib/pipewire"
   '';
-  pulse-libs = pkgs.runCommand "pulse-libs" {} ''
-    mkdir -p "$out/lib"
-    ln -s "${pkgs.pipewire.pulse}/lib" "$out/lib/pipewire"
-  '';
 in {
 
   meta = {
@@ -50,7 +46,7 @@ in {
       };
 
       pulse = {
-        enable = mkEnableOption "PulseAudio emulation";
+        enable = mkEnableOption "PulseAudio server emulation";
       };
     };
   };
@@ -61,23 +57,24 @@ in {
     assertions = [
       {
         assertion = cfg.pulse.enable -> !config.hardware.pulseaudio.enable;
-        message = "PipeWire based PulseAudio emulation doesn't use the PulseAudio service";
+        message = "PipeWire based PulseAudio server emulation replaces PulseAudio";
       }
       {
         assertion = cfg.jack.enable -> !config.services.jack.jackd.enable;
-        message = "PIpeWire based JACK emulation doesn't use the JACK service";
+        message = "PipeWire based JACK emulation doesn't use the JACK service";
       }
     ];
 
     environment.systemPackages = [ pkgs.pipewire ]
-                                 ++ lib.optional cfg.jack.enable jack-libs
-                                 ++ lib.optional cfg.pulse.enable pulse-libs;
+                                 ++ lib.optional cfg.jack.enable jack-libs;
 
-    systemd.packages = [ pkgs.pipewire ];
+    systemd.packages = [ pkgs.pipewire ]
+                       ++ lib.optional cfg.pulse.enable pkgs.pipewire.pulse;
 
     # PipeWire depends on DBUS but doesn't list it. Without this booting
     # into a terminal results in the service crashing with an error.
     systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ];
+    systemd.user.sockets.pipewire-pulse.wantedBy = lib.mkIf (cfg.socketActivation && cfg.pulse.enable) ["sockets.target"];
     systemd.user.services.pipewire.bindsTo = [ "dbus.service" ];
     services.udev.packages = [ pkgs.pipewire ];
 
@@ -100,6 +97,6 @@ in {
       source = "${pkgs.pipewire}/share/alsa/alsa.conf.d/50-pipewire.conf";
     };
     environment.sessionVariables.LD_LIBRARY_PATH =
-      lib.optional (cfg.jack.enable || cfg.pulse.enable) "/run/current-system/sw/lib/pipewire";
+      lib.optional cfg.jack.enable "/run/current-system/sw/lib/pipewire";
   };
 }