diff options
| -rw-r--r-- | configs/pipewire.nix | 28 | ||||
| -rw-r--r-- | systems/bu/config.nix | 2 |
2 files changed, 29 insertions, 1 deletions
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 ]; |
