summaryrefslogtreecommitdiffstats
path: root/modules/hardware/bluetooth.nix
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
committerJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
commit7b79203f54853733d4fae88943829d0e24e6e49f (patch)
treea352d199fad7453332b9308a6295164157729f27 /modules/hardware/bluetooth.nix
parent184bd30bcb303104a4981ac742d8f8961c5477e7 (diff)
downloadnix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.gz
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.bz2
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.zip
massive overhaul
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"];
};
}