2017-01-07 18:16:26 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2018-07-24 10:53:31 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.network-manager-applet;
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
2017-09-26 21:40:31 +00:00
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
2017-01-07 18:16:26 +00:00
|
|
|
options = {
|
|
|
|
services.network-manager-applet = {
|
|
|
|
enable = mkEnableOption "the Network Manager applet";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-07-24 10:53:31 +00:00
|
|
|
config = mkIf cfg.enable {
|
2017-01-07 18:16:26 +00:00
|
|
|
systemd.user.services.network-manager-applet = {
|
2019-06-09 10:13:11 +00:00
|
|
|
Unit = {
|
|
|
|
Description = "Network Manager applet";
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2019-06-09 10:13:11 +00:00
|
|
|
|
|
|
|
Service = {
|
2020-02-01 23:39:17 +00:00
|
|
|
ExecStart = toString
|
|
|
|
([ "${pkgs.networkmanagerapplet}/bin/nm-applet" "--sm-disable" ]
|
|
|
|
++ optional config.xsession.preferStatusNotifierItems
|
|
|
|
"--indicator");
|
2019-06-09 10:13:11 +00:00
|
|
|
};
|
2017-01-07 18:16:26 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|