2021-04-11 00:25:36 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
bluetooth-enable = config.hardware.bluetooth.enable;
|
|
|
|
cfg = config.magic_rb.pulseaudio;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.magic_rb.pulseaudio = {
|
|
|
|
enable = mkEnableOption "Enable pulseaudio, with bluetooth support if bt enabled";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
sound.enable = true;
|
|
|
|
hardware = {
|
|
|
|
pulseaudio = {
|
|
|
|
enable = true;
|
2022-05-23 08:33:01 +02:00
|
|
|
# extraModules = mkIf bluetooth-enable [ pkgs.pulseaudio-modules-bt ];
|
2021-04-11 00:25:36 +02:00
|
|
|
package = mkIf bluetooth-enable pkgs.pulseaudioFull;
|
2022-05-23 08:33:01 +02:00
|
|
|
daemon.config = {
|
|
|
|
default-sample-rate = 96000;
|
|
|
|
default-sample-format = "s32le";
|
|
|
|
resample-method = "speex-float-5";
|
|
|
|
nice-level = -19;
|
|
|
|
};
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
|
|
|
pulseaudio.support32Bit = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services.pulseaudio.enable = true;
|
|
|
|
};
|
|
|
|
}
|