pipewire: migrate services to sane.programs to completely disable socket activation
see: https://github.com/NixOS/nixpkgs/issues/291318
This commit is contained in:
parent
0745e9fc06
commit
0b4efd2ab2
|
@ -101,6 +101,7 @@
|
||||||
./waylock.nix
|
./waylock.nix
|
||||||
./wike.nix
|
./wike.nix
|
||||||
./wine.nix
|
./wine.nix
|
||||||
|
./wireplumber.nix
|
||||||
./wireshark.nix
|
./wireshark.nix
|
||||||
./wob
|
./wob
|
||||||
./xarchiver.nix
|
./xarchiver.nix
|
||||||
|
|
|
@ -5,23 +5,63 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.programs.pipewire = {
|
sane.programs.pipewire = {
|
||||||
persist.byStore.plaintext = [
|
suggestedPrograms = [ "wireplumber" ];
|
||||||
# persist per-device volume levels
|
|
||||||
".local/state/wireplumber"
|
# sandbox.method = "bwrap";
|
||||||
];
|
# sandbox.wrapperType = "inplace"; #< its config files refer to its binaries by full path
|
||||||
|
# # needs to *create* the various device files, so needs write access to the /run/user/$uid directory itself
|
||||||
|
# # sandbox.extraRuntimePaths = [ "/" ];
|
||||||
|
# sandbox.extraPaths = [ "/" ]; #< TODO: narrow this down
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
description = "pipewire: multimedia service";
|
||||||
|
after = [ "graphical-session.target" ];
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${cfg.package}/bin/pipewire";
|
||||||
|
Type = "simple";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5s";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.pipewire-pulse = {
|
||||||
|
description = "pipewire-pulse: Pipewire compatibility layer for PulseAudio clients";
|
||||||
|
after = [ "pipewire.service" ];
|
||||||
|
wantedBy = [ "pipewire.service" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${cfg.package}/bin/pipewire-pulse";
|
||||||
|
Type = "simple";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5s";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.pipewire = lib.mkIf cfg.enabled {
|
# taken from nixos/modules/services/desktops/pipewire/pipewire.nix
|
||||||
enable = true;
|
# removed 32-bit compatibility stuff
|
||||||
package = cfg.package;
|
environment.etc = lib.mkIf cfg.enabled {
|
||||||
alsa.enable = true;
|
"alsa/conf.d/49-pipewire-modules.conf".text = ''
|
||||||
alsa.support32Bit = true; # ??
|
pcm_type.pipewire {
|
||||||
# emulate pulseaudio for legacy apps (e.g. sxmo-utils)
|
libs.native = ${cfg.package}/lib/alsa-lib/libasound_module_pcm_pipewire.so ;
|
||||||
pulse.enable = true;
|
}
|
||||||
socketActivation = false;
|
ctl_type.pipewire {
|
||||||
|
libs.native = ${cfg.package}/lib/alsa-lib/libasound_module_ctl_pipewire.so ;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
"alsa/conf.d/50-pipewire.conf".source = "${cfg.package}/share/alsa/alsa.conf.d/50-pipewire.conf";
|
||||||
|
"alsa/conf.d/99-pipewire-default.conf".source = "${cfg.package}/share/alsa/alsa.conf.d/99-pipewire-default.conf";
|
||||||
};
|
};
|
||||||
systemd.user.services."pipewire".wantedBy = lib.optionals cfg.enabled [ "graphical-session.target" ];
|
|
||||||
systemd.user.services."pipewire-pulse".wantedBy = lib.optionals cfg.enabled [ "graphical-session.target" ];
|
services.udev.packages = lib.mkIf cfg.enabled [
|
||||||
|
cfg.package
|
||||||
|
];
|
||||||
|
# systemd.packages = lib.mkIf cfg.enabled [
|
||||||
|
# cfg.package
|
||||||
|
# ];
|
||||||
|
# environment.systemPackages = lib.mkIf cfg.enabled [
|
||||||
|
# cfg.package
|
||||||
|
# ];
|
||||||
|
|
||||||
# rtkit/RealtimeKit: allow applications which want realtime audio (e.g. Dino? Pulseaudio server?) to request it.
|
# 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.
|
# this might require more configuration (e.g. polkit-related) to work exactly as desired.
|
||||||
|
|
25
hosts/common/programs/wireplumber.nix
Normal file
25
hosts/common/programs/wireplumber.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.wireplumber;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.wireplumber = {
|
||||||
|
persist.byStore.plaintext = [
|
||||||
|
# persist per-device volume levels
|
||||||
|
".local/state/wireplumber"
|
||||||
|
];
|
||||||
|
|
||||||
|
services.wireplumber = {
|
||||||
|
description = "wireplumber: pipewire Multimedia Service Session Manager";
|
||||||
|
after = [ "pipewire.service" ];
|
||||||
|
bindsTo = [ "pipewire.service" ];
|
||||||
|
wantedBy = [ "pipewire.service" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${cfg.package}/bin/wireplumber";
|
||||||
|
Type = "simple";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5s";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user