home-manager/modules/services/network-manager-applet.nix

44 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2017-01-07 18:16:26 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.network-manager-applet;
2020-02-01 23:39:17 +00:00
in {
meta.maintainers = [ maintainers.rycee hm.maintainers.cvoges12 ];
2017-01-07 18:16:26 +00:00
options = {
services.network-manager-applet = {
enable = mkEnableOption "the Network Manager applet";
};
};
config = 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" ];
2017-01-07 18:16:26 +00:00
systemd.user.services.network-manager-applet = {
Unit = {
Description = "Network Manager applet";
Requires = [ "tray.target" ];
After = [ "graphical-session-pre.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
};
2020-02-01 23:39:17 +00:00
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = toString ([ "${pkgs.networkmanagerapplet}/bin/nm-applet" ]
++ optional config.xsession.preferStatusNotifierItems "--indicator");
};
2017-01-07 18:16:26 +00:00
};
};
}