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

43 lines
866 B
Nix
Raw Normal View History

2017-01-07 18:16:26 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.network-manager-applet;
in
2017-01-07 18:16:26 +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";
};
};
config = mkIf cfg.enable {
2017-01-07 18:16:26 +00:00
systemd.user.services.network-manager-applet = {
Unit = {
Description = "Network Manager applet";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
ExecStart = toString (
[
"${pkgs.networkmanagerapplet}/bin/nm-applet"
"--sm-disable"
] ++ optional config.xsession.preferStatusNotifierItems "--indicator"
);
};
2017-01-07 18:16:26 +00:00
};
};
}