54 lines
1.2 KiB
Nix
54 lines
1.2 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
options.custom = with lib; {
|
|
audio = {
|
|
enable = mkEnableOption "Enable audio";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.custom.audio.enable {
|
|
environment.systemPackages = with pkgs; [
|
|
pwvucontrol
|
|
];
|
|
|
|
services.pulseaudio.enable = false;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
jack.enable = true;
|
|
|
|
# disable camera to save battery
|
|
# https://reddit.com/r/linux/comments/1em8biv/psa_pipewire_has_been_halving_your_battery_life/
|
|
wireplumber = {
|
|
enable = true;
|
|
extraConfig = {
|
|
"10-disable-camera" = {
|
|
"wireplumber.profiles" = {
|
|
main."monitor.libcamera" = "disabled";
|
|
};
|
|
};
|
|
"10-bluez" = {
|
|
"monitor.bluez.properties" = {
|
|
"bluez5.enable-sbc-xq" = true;
|
|
"bluez5.enable-msbc" = true;
|
|
"bluez5.enable-hw-volume" = true;
|
|
"bluez5.roles" = [
|
|
"hsp_hs"
|
|
"hsp_ag"
|
|
"hfp_hf"
|
|
"hfp_ag"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|