From 16f9ecf09392b3ae761b47f8949b5304a20e6152 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Mon, 24 Feb 2025 22:27:29 +0100 Subject: [PATCH] Bluetooth module --- flake.nix | 1 + modules/audio.nix | 6 ++++-- modules/bluetooth.nix | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 modules/bluetooth.nix diff --git a/flake.nix b/flake.nix index e02c761..da68564 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,7 @@ ./modules/kernel.nix ./modules/fcitx5.nix ./modules/programs.nix + ./modules/bluetooth.nix ]; }; diff --git a/modules/audio.nix b/modules/audio.nix index 1a43980..2d190c1 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,7 +1,9 @@ { lib, config, ... }: with lib; -let cfg = config.voidconf.audio; -in { +let + cfg = config.voidconf.audio; +in +{ options.voidconf.audio = { enable = mkEnableOption "Enable all the audio daemons"; }; diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix new file mode 100644 index 0000000..22c4edc --- /dev/null +++ b/modules/bluetooth.nix @@ -0,0 +1,26 @@ +{ + pkgs, + lib, + config, + ... +}: +with lib; +let + cfg = config.voiconf.bluetooth; +in +{ + options.voidconf.bluetooth = { + enable = mkEnableOption "Enables bluetooth tools"; + }; + config = mkIf cfg.enable { + hardware.bleutooth = { + enable = true; + }; + services.blueman = { + enable = true; + }; + environment.systemPackages = with pkgs; [ + bluez + ]; + }; +}