1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-30 14:11:02 +01:00
home-manager/modules/services/network-manager-applet.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

55 lines
1.2 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.network-manager-applet;
in
{
meta.maintainers = [
lib.maintainers.rycee
lib.maintainers.midischwarz12
];
options = {
services.network-manager-applet = {
enable = lib.mkEnableOption "the Network Manager applet (nm-applet)";
};
};
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.network-manager-applet" pkgs lib.platforms.linux)
];
# The package provides some icons that are good to have available.
xdg.systemDirs.data = [ "${pkgs.networkmanagerapplet}/share" ];
systemd.user.services.network-manager-applet = {
Unit = {
Description = "Network Manager applet";
Requires = [ "tray.target" ];
After = [
"graphical-session.target"
"tray.target"
];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
ExecStart = toString (
[ "${pkgs.networkmanagerapplet}/bin/nm-applet" ]
++ lib.optional config.xsession.preferStatusNotifierItems "--indicator"
);
};
};
};
}