From 95cbb71abecf50a2c616b1ab60f866f427cc1fd7 Mon Sep 17 00:00:00 2001 From: Tobias Happ Date: Sun, 2 Dec 2018 12:18:47 +0100 Subject: [PATCH] nixos/nm-applet: add nm-applet program --- nixos/doc/manual/release-notes/rl-1903.xml | 4 +- nixos/modules/module-list.nix | 1 + nixos/modules/programs/nm-applet.nix | 43 ++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/programs/nm-applet.nix diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml index 376a5355f7c9..65cc166c9a07 100644 --- a/nixos/doc/manual/release-notes/rl-1903.xml +++ b/nixos/doc/manual/release-notes/rl-1903.xml @@ -39,7 +39,9 @@ - + + ./programs/nm-applet.nix + diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 75e8446523f9..f81877d57d21 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -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 diff --git a/nixos/modules/programs/nm-applet.nix b/nixos/modules/programs/nm-applet.nix new file mode 100644 index 000000000000..311a75deb198 --- /dev/null +++ b/nixos/modules/programs/nm-applet.nix @@ -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"; + }; + + }; + +}