2017-01-07 19:16:26 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2018-07-24 12:53:31 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.network-manager-applet;
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2023-08-02 01:44:46 +02:00
|
|
|
meta.maintainers = [ maintainers.rycee hm.maintainers.cvoges12 ];
|
2017-09-26 23:40:31 +02:00
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
options = {
|
|
|
|
services.network-manager-applet = {
|
|
|
|
enable = mkEnableOption "the Network Manager applet";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-07-24 12:53:31 +02:00
|
|
|
config = mkIf cfg.enable {
|
2021-07-07 23:24:27 +02:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.network-manager-applet" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2024-01-26 23:04:20 +01:00
|
|
|
# The package provides some icons that are good to have available.
|
|
|
|
xdg.systemDirs.data = [ "${pkgs.networkmanagerapplet}/share" ];
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
systemd.user.services.network-manager-applet = {
|
2019-06-09 12:13:11 +02:00
|
|
|
Unit = {
|
|
|
|
Description = "Network Manager applet";
|
2021-05-22 04:15:12 +02:00
|
|
|
Requires = [ "tray.target" ];
|
|
|
|
After = [ "graphical-session-pre.target" "tray.target" ];
|
2019-06-09 12:13:11 +02:00
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2019-06-09 12:13:11 +02:00
|
|
|
|
|
|
|
Service = {
|
2023-08-02 01:44:46 +02:00
|
|
|
ExecStart = toString ([ "${pkgs.networkmanagerapplet}/bin/nm-applet" ]
|
|
|
|
++ optional config.xsession.preferStatusNotifierItems "--indicator");
|
2019-06-09 12:13:11 +02:00
|
|
|
};
|
2017-01-07 19:16:26 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|