1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8{
9 meta = {
10 maintainers = lib.teams.freedesktop.members;
11 };
12
13 options.programs.nm-applet = {
14 enable = lib.mkEnableOption "nm-applet, a NetworkManager control applet for GNOME";
15
16 indicator = lib.mkOption {
17 type = lib.types.bool;
18 default = true;
19 description = ''
20 Whether to use indicator instead of status icon.
21 It is needed for Appindicator environments, like Enlightenment.
22 '';
23 };
24 };
25
26 config = lib.mkIf config.programs.nm-applet.enable {
27 systemd.user.services.nm-applet = {
28 description = "Network manager applet";
29 wantedBy = [ "graphical-session.target" ];
30 partOf = [ "graphical-session.target" ];
31 after = [ "graphical-session.target" ];
32 serviceConfig.ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet ${lib.optionalString config.programs.nm-applet.indicator "--indicator"}";
33 };
34
35 services.dbus.packages = [ pkgs.gcr ];
36 };
37}