2021-11-21 19:07:12 +01:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.eboskma.sound;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.eboskma.sound.enable = mkEnableOption "activate sound settings";
|
|
|
|
|
|
|
|
config = mkIf (cfg.enable) {
|
|
|
|
sound.enable = true;
|
|
|
|
services = {
|
|
|
|
pipewire = {
|
|
|
|
enable = true;
|
|
|
|
pulse.enable = true;
|
2022-01-15 17:45:30 +01:00
|
|
|
media-session = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
config = {
|
|
|
|
bluez-monitor.rules = [
|
|
|
|
{
|
|
|
|
matches = [{ "device.name" = "~bluez_card.*"; }];
|
|
|
|
actions = {
|
|
|
|
"update-props" = {
|
|
|
|
"bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ];
|
|
|
|
"bluez5.msbc-support" = true;
|
|
|
|
"bluez5.sbc-xq-support" = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
matches = [
|
|
|
|
{ "node.name" = "~bluez_input.*"; }
|
|
|
|
{ "node.name" = "~bluez_output.*"; }
|
|
|
|
];
|
|
|
|
actions = {
|
|
|
|
"node.pause-on-idle" = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
};
|
2021-12-18 16:23:14 +01:00
|
|
|
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
environment.systemPackages = with pkgs; [ pavucontrol ];
|
|
|
|
|
|
|
|
users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "audio" ];
|
|
|
|
};
|
|
|
|
}
|