summaryrefslogtreecommitdiffstats
path: root/modules/hardware/bluetooth.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/hardware/bluetooth.nix')
-rw-r--r--modules/hardware/bluetooth.nix34
1 files changed, 22 insertions, 12 deletions
diff --git a/modules/hardware/bluetooth.nix b/modules/hardware/bluetooth.nix
index 1465d68..7f835bf 100644
--- a/modules/hardware/bluetooth.nix
+++ b/modules/hardware/bluetooth.nix
@@ -1,16 +1,26 @@
-{ config, lib, pkgs, ... }:
{
- hardware.bluetooth.enable = true;
- services.blueman.enable = true;
+ config,
+ options,
+ lib,
+ pkgs,
+ ...
+}: let
+ bluetoothConfig = config.modules.hardware.bluetooth;
+ device = config.modules.device;
+in {
+ options.modules.hardware.bluetooth = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = true;
+ };
+ };
- environment.etc = {
- "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 ]"
-}
- '';
+ config = lib.mkIf (bluetoothConfig.enable && device.hasBluetooth) {
+ hardware.bluetooth = {
+ enable = true;
+ package = pkgs.bluez;
+ powerOnBoot = true;
+ };
+ user.extraGroups = ["bluetooth"];
};
}