diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2024-01-07 12:00:08 -0500 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2024-01-07 12:00:08 -0500 |
commit | 7b79203f54853733d4fae88943829d0e24e6e49f (patch) | |
tree | a352d199fad7453332b9308a6295164157729f27 /modules/hardware/audio.nix | |
parent | 184bd30bcb303104a4981ac742d8f8961c5477e7 (diff) | |
download | nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.gz nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.bz2 nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.zip |
massive overhaul
Diffstat (limited to 'modules/hardware/audio.nix')
-rw-r--r-- | modules/hardware/audio.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/hardware/audio.nix b/modules/hardware/audio.nix new file mode 100644 index 0000000..3ffa32a --- /dev/null +++ b/modules/hardware/audio.nix @@ -0,0 +1,44 @@ +{ + 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; + }; + + user.extraGroups = ["audio"]; + home.packages = [pkgs.pavucontrol]; + } + (lib.mkIf (device.hasBluetooth) { + home.configFile = { + "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + ''; + }; + }) + ]); +} |