about summary refs log tree commit diff
path: root/nixos/modules/programs/nm-applet.nix
blob: 311a75deb19803c930850831eedf02e364e2f4da (plain) (blame)
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
37
38
39
40
41
42
43
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.programs.nm-applet;
in

{

  ###### interface

  options = {

    programs.nm-applet = {

      enable = mkOption {
        type = types.bool;
        default = false;
        description = ''
          Whether to enable nm-applet.
        '';
      };

    };

  };


  ###### implementation

  config = mkIf cfg.enable {

    systemd.user.services.nm-applet = {
      description = "Network manager applet";
      wantedBy = [ "graphical-session.target" ];
      partOf = [ "graphical-session.target" ];
      serviceConfig.ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet";
    };

  };

}