aboutsummaryrefslogtreecommitdiff
path: root/modules/workstation
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-02-04 20:16:29 +0100
committerKatharina Fey <kookie@spacekookie.de>2020-02-04 20:23:26 +0100
commita116982a26e76c89dce253b8c9538aaaeafbb1af (patch)
tree231047753fcfecfdb8a0697c56eac6af5945f429 /modules/workstation
parentc87cde76ce3221350c10baef6c680cc0ed120eca (diff)
bluetooth: adding conditional pulseaudio modes and blueman daemon
Diffstat (limited to 'modules/workstation')
-rw-r--r--modules/workstation/hardware/bluetooth/default.nix11
-rw-r--r--modules/workstation/sound/default.nix20
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 [];
+ };
}
+