about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/package-notes.xml10
-rw-r--r--pkgs/applications/networking/irc/weechat/default.nix6
2 files changed, 9 insertions, 7 deletions
diff --git a/doc/package-notes.xml b/doc/package-notes.xml
index 184bee089ae3..b657f5809db9 100644
--- a/doc/package-notes.xml
+++ b/doc/package-notes.xml
@@ -667,11 +667,13 @@ cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
 <section xml:id="sec-weechat">
 <title>Weechat</title>
 <para>
-Weechat can currently be configured to include your choice of plugins.
-To make use of this functionality, install an expression that overrides its configuration such as
+Weechat can be configured to include your choice of plugins, reducing its
+closure size from the default configuration which includes all available
+plugins.  To make use of this functionality, install an expression that
+overrides its configuration such as
 <programlisting>weechat.override {configure = {availablePlugins, ...}: {
-        plugins = with availablePlugins; [ python perl ];
-    }
+    plugins = with availablePlugins; [ python perl ];
+  }
 }</programlisting>
 </para>
 <para>
diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix
index 1b730af54fea..437cb2369854 100644
--- a/pkgs/applications/networking/irc/weechat/default.nix
+++ b/pkgs/applications/networking/irc/weechat/default.nix
@@ -11,7 +11,7 @@
 , rubySupport ? true, ruby
 , tclSupport ? true, tcl
 , extraBuildInputs ? []
-, configure ? null
+, configure ? { availablePlugins, ... }: { plugins = builtins.attrValues availablePlugins; }
 , runCommand }:
 
 let
@@ -121,9 +121,9 @@ in if configure == null then weechat else
         ln -s $plugin $out/plugins
       done
     '';
-  in writeScriptBin "weechat" ''
+  in (writeScriptBin "weechat" ''
     #!${stdenv.shell}
     export WEECHAT_EXTRA_LIBDIR=${pluginsDir}
     ${lib.concatMapStringsSep "\n" (p: lib.optionalString (p ? extraEnv) p.extraEnv) plugins}
     exec ${weechat}/bin/weechat "$@"
-  ''
+  '') // { unwrapped = weechat; }