summaryrefslogblamecommitdiffstats
path: root/modules/hardware/audio.nix
blob: a67459780003799fe9900fa935f93a2f4c234331 (plain) (tree)
























                                                         







                                                                 



                                               
           

       
{
    config,
    options,
    lib,
    pkgs,
    ...
}: let
    audioConfig = config.modules.hardware.audio;
    device = config.modules.device;
in {
    options.modules.hardware.audio = {
        enable = lib.mkOption {
            type = lib.types.bool;
            default = true;
        };
    };

    config = lib.mkIf (audioConfig.enable) (lib.mkMerge [
        {
            security.rtkit.enable = true;
            services.pipewire = {
                enable = true;
                alsa.enable = true;
                alsa.support32Bit = true;
                pulse.enable = true;

                wireplumber.extraConfig.bluetoothEnhancements = {
                  "monitor.bluez.properties" = {
                  "bluez5.enable-sbc-xq" = true;
                  "bluez5.enable-msbc" = true;
                  "bluez5.enable-hw-volume" = true;
                };
              };
            };

            user.extraGroups = ["audio"];
            home.packages = [pkgs.pavucontrol];
          }
    ]);
}