diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-02-04 20:16:29 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-02-04 20:23:26 +0100 |
commit | a116982a26e76c89dce253b8c9538aaaeafbb1af (patch) | |
tree | 231047753fcfecfdb8a0697c56eac6af5945f429 /modules/workstation/sound | |
parent | c87cde76ce3221350c10baef6c680cc0ed120eca (diff) |
bluetooth: adding conditional pulseaudio modes and blueman daemon
Diffstat (limited to 'modules/workstation/sound')
-rw-r--r-- | modules/workstation/sound/default.nix | 20 |
1 files changed, 17 insertions, 3 deletions
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 []; + }; } + |