[Desktop/Multimedia] update Pipewire config for NixOS 24.05

Also disable AirPlay support by default, as it is currently broken.
This commit is contained in:
Antoine Viallon 2024-05-23 10:43:30 +02:00
parent 0d5846158f
commit 244c878108
Signed by: aviallon
GPG key ID: 186FC35EDEB25716
2 changed files with 36 additions and 39 deletions

View file

@ -36,7 +36,7 @@ in {
default = true;
example = false;
};
airplay.enable = (mkEnableOption "AirPlay sink device support") // { default = true; };
airplay.enable = mkEnableOption "AirPlay sink device support";
};
graphics = {
shaderCache = {

View file

@ -72,6 +72,40 @@ in {
ResumeDelay = 4;
};
};
services.pipewire.extraConfig.pipewire = {
"10-combined-outputs" = {
"context.modules" = [
{
name = "libpipewire-module-combine-stream";
args = {
"combine.mode" = "sink";
"node.name" = "combine_sink";
"node.description" = "Sortie combinée";
"combine.latency-compensate" = true;
"combine.props" = {
"audio.position" = [ "FL" "FR" ];
};
"stream.props" = {};
"stream.rules" = [
{
matches = [
# any of the items in matches needs to match, if one does,
# actions are emited.
{
# all keys must match the value. ! negates. ~ starts regex.
#node.name = "~alsa_input.*"
"media.class" = "Audio/Sink";
}
];
actions.create-stream = {};
}
];
};
}
];
};
};
environment.etc = {
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
@ -82,43 +116,6 @@ in {
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'';
"pipewire/pipewire.conf.d/combined-outputs.conf".text = ''
context.modules = [
{ name = libpipewire-module-combine-stream
args = {
combine.mode = sink
node.name = "combine_sink"
node.description = "Sortie combinée"
combine.latency-compensate = true
combine.props = {
audio.position = [ FL FR ]
}
stream.props = {
}
stream.rules = [
{
matches = [
# any of the items in matches needs to match, if one does,
# actions are emited.
{
# all keys must match the value. ! negates. ~ starts regex.
#node.name = "~alsa_input.*"
media.class = "Audio/Sink"
}
]
actions = {
create-stream = {
#combine.audio.position = [ FL FR ]
#audio.position = [ FL FR ]
}
}
}
]
}
}
]
'';
};
security.rtkit.enable = true; # Real-time support for pipewire
@ -135,7 +132,7 @@ in {
};
serviceConfig = {
ExecStart = [
"${pkgs.pipewire}/bin/pipewire -c ${conf}"
"${getBin config.services.pipewire.package}/bin/pipewire -c ${conf}"
];
Type = "simple";
Restart = "on-failure";