nixos/nm-applet: add nm-applet program

This commit is contained in:
Tobias Happ 2018-12-02 12:18:47 +01:00
parent d9b650f4cc
commit 95cbb71abe
3 changed files with 47 additions and 1 deletions

View File

@ -39,7 +39,9 @@
<itemizedlist>
<listitem>
<para />
<para>
<literal>./programs/nm-applet.nix</literal>
</para>
</listitem>
</itemizedlist>
</section>

View File

@ -106,6 +106,7 @@
./programs/mininet.nix
./programs/mtr.nix
./programs/nano.nix
./programs/nm-applet.nix
./programs/npm.nix
./programs/oblogout.nix
./programs/plotinus.nix

View File

@ -0,0 +1,43 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.nm-applet;
in
{
###### interface
options = {
programs.nm-applet = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable nm-applet.
'';
};
};
};
###### implementation
config = mkIf cfg.enable {
systemd.user.services.nm-applet = {
description = "Network manager applet";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet";
};
};
}