summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/desktops/adw-bluetooth.nix
blob: 43c6cfe4e43602ed3d962190587a06c034e049b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.services.adw-bluetooth;
in
{
  meta.maintainers = with lib.maintainers; [ ezratweaver ];

  options.services.adw-bluetooth = {
    enable = lib.mkEnableOption "Adwaita Bluetooth daemon";
    package = lib.mkPackageOption pkgs "adw-bluetooth" { };
  };

  config = lib.mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];
    services.dbus.packages = [ cfg.package ];

    systemd.user.services.adw-bluetooth-daemon = {
      description = "AdwBluetooth Daemon";
      wantedBy = [ "default.target" ];
      after = [ "bluetooth.target" ];
      serviceConfig = {
        Type = "dbus";
        BusName = "com.ezratweaver.AdwBluetoothDaemon";
        ExecStart = "${cfg.package}/libexec/adw-bluetooth-daemon";
      };
    };
  };
}