mirror of
https://github.com/nix-community/home-manager
synced 2024-09-10 05:16:29 +02:00
The Network Manager Applet package provides, for example, some icons that are good to have accessible in an XDG data directory.
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.network-manager-applet;
|
|
|
|
in {
|
|
meta.maintainers = [ maintainers.rycee hm.maintainers.cvoges12 ];
|
|
|
|
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" ];
|
|
|
|
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" ];
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
Service = {
|
|
ExecStart = toString ([ "${pkgs.networkmanagerapplet}/bin/nm-applet" ]
|
|
++ optional config.xsession.preferStatusNotifierItems "--indicator");
|
|
};
|
|
};
|
|
};
|
|
}
|