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 ++++++++++++++++++++++++++++ systems/bu/config.nix | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 configs/pipewire.nix 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" ]; +} diff --git a/systems/bu/config.nix b/systems/bu/config.nix index 39d1007d..5762a1dd 100644 --- a/systems/bu/config.nix +++ b/systems/bu/config.nix @@ -4,7 +4,7 @@ ../../configs/hw/x220.nix ../../configs/exim-retiolum.nix ../../configs/gitconfig.nix - ../../configs/pulse.nix + ../../configs/pipewire.nix ../../configs/retiolum.nix ../../configs/xsessions ]; -- cgit v1.3.1