{ lib, config, pkgs, ... }:

with lib;

let
  cfg = config.roles.bluetooth;
in
{
  options.roles.bluetooth = {
    enable = mkEnableOption "Enable the bluetooth role";
  };

  config = mkIf cfg.enable
    {
      hardware.bluetooth.enable = true;
      hardware.bluetooth.powerOnBoot = true;
      hardware.bluetooth.settings = {
        General = {
          Enable = "Source,Sink,Media,Socket";
        };
      };

      services.blueman.enable = true;
    };

}
