1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-05 10:49:44 +01:00
home-manager/modules/services/network-manager-applet.nix

43 lines
1,018 B
Nix
Raw Normal View History

2017-01-07 19:16:26 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.network-manager-applet;
2020-02-02 00:39:17 +01:00
in {
meta.maintainers = [ maintainers.rycee ];
2017-01-07 19:16:26 +01: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)
];
2017-01-07 19:16:26 +01: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-02 00:39:17 +01:00
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
2020-02-02 00:39:17 +01:00
ExecStart = toString
([ "${pkgs.networkmanagerapplet}/bin/nm-applet" "--sm-disable" ]
++ optional config.xsession.preferStatusNotifierItems
"--indicator");
};
2017-01-07 19:16:26 +01:00
};
};
}