From 4313cb0e66b7e056f04457fba59012e22f63f04b Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Dec 2026 04:38:58 +0000 Subject: bu: PipeWire instead of PulseAudio configs/pipewire.nix runs it system-wide, as configs/pulse.nix did PulseAudio, so that several users can play audio at the same time. Instead of its anonymous socket, the sockets are for the group pipewire, which the host's build user joins. Clients learn the sockets' places from PIPEWIRE_RUNTIME_DIR and PULSE_SERVER. Without the tunnel to au, for now. --- configs/pipewire.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 configs/pipewire.nix (limited to 'configs') diff --git a/configs/pipewire.nix b/configs/pipewire.nix new file mode 100644 index 00000000..1331d5fc --- /dev/null +++ b/configs/pipewire.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: let + # Where system-wide PipeWire's sockets are, as clients need to be told. + environment = { + PIPEWIRE_RUNTIME_DIR = "/run/pipewire"; + PULSE_SERVER = "unix:/run/pulse/native"; + }; +in { + # System-wide, so that several users can play audio at the same time. + # Its sockets are for the group pipewire. + services.pipewire = { + enable = true; + systemWide = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + security.rtkit.enable = true; + + environment.sessionVariables = environment; + systemd.globalEnvironment = environment; + + environment.systemPackages = lib.optionals config.services.xserver.enable [ + pkgs.pwvucontrol + ]; + + users.users.${config.krebs.build.user.name}.extraGroups = [ "pipewire" ]; +} -- cgit v1.3.1