diff options
-rw-r--r-- | modules/workstation/hardware/bluetooth/default.nix | 11 | ||||
-rw-r--r-- | modules/workstation/sound/default.nix | 20 |
2 files changed, 27 insertions, 4 deletions
diff --git a/modules/workstation/hardware/bluetooth/default.nix b/modules/workstation/hardware/bluetooth/default.nix index fb6a06a03e5..ca628c53cd3 100644 --- a/modules/workstation/hardware/bluetooth/default.nix +++ b/modules/workstation/hardware/bluetooth/default.nix @@ -1,5 +1,14 @@ { ... }: { - hardware.bluetooth.enable = true; + hardware.bluetooth = { + enable = true; + config = { + General = { + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; + + services.blueman.enable = true; } diff --git a/modules/workstation/sound/default.nix b/modules/workstation/sound/default.nix index 5d10b71ffdc..6b456b5136b 100644 --- a/modules/workstation/sound/default.nix +++ b/modules/workstation/sound/default.nix @@ -1,5 +1,19 @@ -{ ... }: { +{ config, pkgs, ... }: + +{ sound.enable = true; - hardware.pulseaudio.enable = true; - hardware.pulseaudio.zeroconf.discovery.enable = true; + hardware.pulseaudio = let + bt = config.hardware.bluetooth.enable; + in + with pkgs; + { + enable = true; + zeroconf.discovery.enable = true; + + # If a computer has bluetooth enabled, we want to pull in the + # "big" pulseaudio package that includes bluetooth support. + package = if bt then pulseaudioFull else pulseaudio; + extraModules = if bt then [ pulseaudio-modules-bt ] else []; + }; } + |