2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.network-manager-applet;
|
|
|
|
|
|
|
|
in {
|
2023-08-08 10:19:01 +00:00
|
|
|
meta.maintainers = [ maintainers.rycee hm.maintainers.cvoges12 ];
|
2020-10-12 00:22:58 +00:00
|
|
|
|
|
|
|
options = {
|
|
|
|
services.network-manager-applet = {
|
|
|
|
enable = mkEnableOption "the Network Manager applet";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-11-04 16:42:44 +00:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.network-manager-applet" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
systemd.user.services.network-manager-applet = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Network Manager applet";
|
2021-07-02 22:36:30 +00:00
|
|
|
Requires = [ "tray.target" ];
|
|
|
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
2020-10-12 00:22:58 +00:00
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
|
|
|
|
Service = {
|
2023-08-08 10:19:01 +00:00
|
|
|
ExecStart = toString ([ "${pkgs.networkmanagerapplet}/bin/nm-applet" ]
|
|
|
|
++ optional config.xsession.preferStatusNotifierItems "--indicator");
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|