diff --git a/default.nix b/default.nix index 4dbfeefb..b6a461ac 100644 --- a/default.nix +++ b/default.nix @@ -15,6 +15,7 @@ in disableLaptopKeyboard = true; lidIgnore = true; powerIgnore = true; + bluetooth = true; }; system = { diff --git a/modules/hardware.nix b/modules/hardware.nix index 8e6d1aca..fb6ef64d 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -4,7 +4,7 @@ let inherit (lib) mkEnableOption mkIf getExe singleton; inherit (pkgs) piper interception-tools; inherit (pkgs.interception-tools-plugins) dual-function-keys; - inherit (cfg) mouseSettings disableLaptopKeyboard lidIgnore powerIgnore keyboardBinds; + inherit (cfg) mouseSettings disableLaptopKeyboard lidIgnore powerIgnore keyboardBinds bluetooth; inherit (builtins) toJSON; dualFunctionKeysConfig = "dual-function-keys.yaml"; @@ -15,14 +15,18 @@ in options.modules.hardware = { keyboardBinds = mkEnableOption "start button for rofi, caps lock as escape, etc."; mouseSettings = mkEnableOption "piper for gaming mice"; + bluetooth = mkEnableOption "bluetooth support"; disableLaptopKeyboard = mkEnableOption "udev rule to disable laptop keyboard"; lidIgnore = mkEnableOption "ignoring the laptop lid on close"; powerIgnore = mkEnableOption "ignoring the power button on press"; }; config = { + hardware.bluetooth.enable = mkIf bluetooth true; + services = { ratbagd.enable = mkIf mouseSettings true; + blueman.enable = mkIf bluetooth true; udev.extraRules = mkIf disableLaptopKeyboard '' KERNEL=="event*", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"