sway: split pipewire config into separate sane.programs.pipewire

This commit is contained in:
Colin 2024-02-21 23:23:52 +00:00
parent 386651044e
commit fd9f500e97
3 changed files with 20 additions and 11 deletions

View File

@ -69,6 +69,7 @@
./obsidian.nix
./offlineimap.nix
./open-in-mpv.nix
./pipewire.nix
./planify.nix
./portfolio-filemanager.nix
./playerctl.nix

View File

@ -0,0 +1,18 @@
# administer with pw-cli, pw-mon, pw-top commands
{ config, lib, ... }:
let
cfg = config.sane.programs.pipewire;
in
{
services.pipewire = lib.mkIf cfg.enabled {
enable = true;
package = cfg.package;
alsa.enable = true;
alsa.support32Bit = true; # ??
# emulate pulseaudio for legacy apps (e.g. sxmo-utils)
pulse.enable = true;
# TODO: try:
# socketActivation = false;
};
systemd.user.services."pipewire".wantedBy = lib.optionals cfg.enabled [ "graphical-session.target" ];
}

View File

@ -109,6 +109,7 @@ in
"fuzzel"
# "gnome.gnome-bluetooth" # XXX(2023/05/14): broken
# "gnome.gnome-control-center" # XXX(2023/06/28): depends on webkitgtk4_1
"pipewire"
"playerctl" # for waybar & particularly to have playerctld running
"pulsemixer" # for volume controls
"splatmoji" # used by sway config
@ -211,17 +212,6 @@ in
});
};
# unlike other DEs, sway configures no audio stack
# administer with pw-cli, pw-mon, pw-top commands
services.pipewire = lib.mkIf cfg.enabled {
enable = true;
alsa.enable = true;
alsa.support32Bit = true; # ??
# emulate pulseaudio for legacy apps (e.g. sxmo-utils)
pulse.enable = true;
};
systemd.user.services."pipewire".wantedBy = lib.optionals cfg.enabled [ "graphical-session.target" ];
# rtkit/RealtimeKit: allow applications which want realtime audio (e.g. Dino? Pulseaudio server?) to request it.
# this might require more configuration (e.g. polkit-related) to work exactly as desired.
# - readme outlines requirements: <https://github.com/heftig/rtkit>