From f54612264edd7d743488e6469b5f774dbc07e7b7 Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Sat, 18 Jul 2020 13:32:48 +0200 Subject: nixos/jack,pulseaudio: fix pulse connection to jackd service This fixes the case when Jack Audio Daemon is running as a service via `services.jack.jackd` and Pulseaudio running as a *user* service. Two issues prevented connecting `pulse` with `jackd`: * Missing `JACK_PROMISCUOUS_SERVER` environment variable for `pulse` user service, resulting in `pulse` trying to access `jackd` as if it was running as part of the users session. * `jackd` not being able to access socket created by `pulse` due to socket created using user ID and `users` group. Change allows `jackd` to access the socket created by `pulse` correctly. `pulse` now also autoloads `module-jack-sink` and `module-jack-source` if `services.jack.jackd.enable` is set. The default `pulse` package is now set to `pulseaudioFull` automatically if `services.jack.jackd.enable` is set. --- nixos/modules/services/audio/jack.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nixos/modules/services/audio') diff --git a/nixos/modules/services/audio/jack.nix b/nixos/modules/services/audio/jack.nix index ceff366d0bbb..bee97dbfc6b3 100644 --- a/nixos/modules/services/audio/jack.nix +++ b/nixos/modules/services/audio/jack.nix @@ -246,6 +246,9 @@ in { description = "JACK Audio Connection Kit"; serviceConfig = { User = "jackaudio"; + SupplementaryGroups = lib.optional + (config.hardware.pulseaudio.enable + && !config.hardware.pulseaudio.systemWide) "users"; ExecStart = "${cfg.jackd.package}/bin/jackd ${lib.escapeShellArgs cfg.jackd.extraOptions}"; LimitRTPRIO = 99; LimitMEMLOCK = "infinity"; -- cgit v1.2.3