nixos-config/modules/sound/default.nix
Erwin Boskma e23365360f
Remove services.pipewire.media-session
It was removed from the module in favor of wireplumber
2023-04-03 09:49:40 +02:00

46 lines
1.1 KiB
Nix

{ 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;
alsa.enable = true;
wireplumber.enable = true;
};
};
environment.etc = {
bluez_monitor = mkIf config.eboskma.bluetooth.enable {
target = "wireplumber/bluetooth.lua.d/50-bluez-config.lua";
text = ''
bluez_monitor.properties = {
["bluez5.enable-msbc"] = true,
["bluez5.enable-sbc-xq"] = true,
["bluez5.headset-roles"] = "[ hfp_hf hsp_hs hsp_ag hfp_ag ]",
["bluez5.codecs"] = "[ sbc sbc_xq aac ]",
["bluez5.hfphsp-backend"] = "native",
["bluez5.default.rate"] = 48000,
["bluez5.default.channels"] = 2,
}
'';
};
};
security.rtkit.enable = true;
environment.systemPackages = with pkgs; [ pavucontrol ];
users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "audio" ];
};
}