aboutsummaryrefslogtreecommitdiff
path: root/modules/services/blueman-applet.nix
blob: 5a57acccc27695e998af830f4251aee369d69bb7 (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
35
36
{ config, lib, pkgs, ... }:

with lib;

{
  options = {
    services.blueman-applet = {
      enable = mkEnableOption "" // {
        description = ''
          Whether to enable the Blueman applet.
          </para><para>
          Note, for the applet to work, the 'blueman' service should
          be enabled system-wide. You can enable it in the system
          configuration using
          <programlisting language="nix">
            services.blueman.enable = true;
          </programlisting>
        '';
      };
    };
  };

  config = mkIf config.services.blueman-applet.enable {
    systemd.user.services.blueman-applet = {
      Unit = {
        Description = "Blueman applet";
        After = [ "graphical-session-pre.target" ];
        PartOf = [ "graphical-session.target" ];
      };

      Install = { WantedBy = [ "graphical-session.target" ]; };

      Service = { ExecStart = "${pkgs.blueman}/bin/blueman-applet"; };
    };
  };
}