From b64c85e314abb7632718f1bcad34eb02cc6aa924 Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Mon, 2 Dec 2024 21:19:22 -0600 Subject: [PATCH] modularize bluetooth --- sys/modules/bluetooth.nix | 29 +++++++++++++++++++++++++++++ sys/modules/default.nix | 1 + 2 files changed, 30 insertions(+) create mode 100644 sys/modules/bluetooth.nix diff --git a/sys/modules/bluetooth.nix b/sys/modules/bluetooth.nix new file mode 100644 index 0000000..28dbb01 --- /dev/null +++ b/sys/modules/bluetooth.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.sys.bluetooth; +in { + options.local.sys.bluetooth = { + enable = mkEnableOption "bluetooth settings"; + }; + config = mkIf cfg.enable { + hardware = { + bluetooth = { + enable = true; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; + }; + + services = { + blueman.enable = true; + }; + }; +} diff --git a/sys/modules/default.nix b/sys/modules/default.nix index 0696df5..2f2bccf 100644 --- a/sys/modules/default.nix +++ b/sys/modules/default.nix @@ -12,5 +12,6 @@ ./virtualisation.nix ./android.nix ./users.nix + ./bluetooth.nix ]; }