From 95cbb71abecf50a2c616b1ab60f866f427cc1fd7 Mon Sep 17 00:00:00 2001 From: Tobias Happ Date: Sun, 2 Dec 2018 12:18:47 +0100 Subject: [PATCH 1/3] 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"; + }; + + }; + +} From b3662053b3b05160dcb5759e583c9aedb85722ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 2 Dec 2018 11:34:26 +0000 Subject: [PATCH 2/3] nixos/nm-applet: make the module smaller more readable imho --- nixos/modules/programs/nm-applet.nix | 33 ++-------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/nixos/modules/programs/nm-applet.nix b/nixos/modules/programs/nm-applet.nix index 311a75deb198..e42219e9638c 100644 --- a/nixos/modules/programs/nm-applet.nix +++ b/nixos/modules/programs/nm-applet.nix @@ -1,43 +1,14 @@ { config, lib, pkgs, ... }: -with lib; - -let - cfg = config.programs.nm-applet; -in - { + options.programs.nm-applet.enable = lib.mkEnableOption "nm-applet"; - ###### interface - - options = { - - programs.nm-applet = { - - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable nm-applet. - ''; - }; - - }; - - }; - - - ###### implementation - - config = mkIf cfg.enable { - + config = lib.mkIf config.programs.nm-applet.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"; }; - }; - } From 4c7b012d8513a8ada12c30e211e95269ae39bab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 2 Dec 2018 11:45:51 +0000 Subject: [PATCH 3/3] networkmanager-applet: set default icon theme --- pkgs/tools/networking/network-manager/applet.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/network-manager/applet.nix b/pkgs/tools/networking/network-manager/applet.nix index bead4556cb7a..63c142d760aa 100644 --- a/pkgs/tools/networking/network-manager/applet.nix +++ b/pkgs/tools/networking/network-manager/applet.nix @@ -28,7 +28,7 @@ in stdenv.mkDerivation rec { gnome3.gtk networkmanager libnotify libsecret gsettings-desktop-schemas polkit isocodes mobile-broadband-provider-info libgudev modemmanager jansson glib-networking - libappindicator-gtk3 + libappindicator-gtk3 gnome3.defaultIconTheme ] ++ stdenv.lib.optionals withGnome [ gnome3.gcr ]; # advanced certificate chooser nativeBuildInputs = [ meson ninja intltool pkgconfig wrapGAppsHook gobjectIntrospection python3 gtk-doc docbook_xsl docbook_xml_dtd_43 libxml2 ];