summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2018-09-07 17:19:46 +0200
committerGitHub <noreply@github.com>2018-09-07 17:19:46 +0200
commite326c0156d71fa12e1ef4aa0930c18cd5ba78a40 (patch)
treeeae01858bc5c9fda4c7378a4887842acc6d2a386 /doc
parent00c6f85d18f12552437618e455feab1938215699 (diff)
parentf5becfb5b02f9071472abe61e86460e41dbb7a5c (diff)
downloadnixpkgs-e326c0156d71fa12e1ef4aa0930c18cd5ba78a40.tar
nixpkgs-e326c0156d71fa12e1ef4aa0930c18cd5ba78a40.tar.gz
nixpkgs-e326c0156d71fa12e1ef4aa0930c18cd5ba78a40.tar.bz2
nixpkgs-e326c0156d71fa12e1ef4aa0930c18cd5ba78a40.tar.lz
nixpkgs-e326c0156d71fa12e1ef4aa0930c18cd5ba78a40.tar.xz
nixpkgs-e326c0156d71fa12e1ef4aa0930c18cd5ba78a40.tar.zst
nixpkgs-e326c0156d71fa12e1ef4aa0930c18cd5ba78a40.zip
Merge pull request #45728 from Ma27/nixos/weechat-module
nixos/weechat: add module
Diffstat (limited to 'doc')
-rw-r--r--doc/package-notes.xml51
1 files changed, 51 insertions, 0 deletions
diff --git a/doc/package-notes.xml b/doc/package-notes.xml
index c2aef8937b0..1f088e8aaa0 100644
--- a/doc/package-notes.xml
+++ b/doc/package-notes.xml
@@ -671,6 +671,8 @@ overrides = super: self: rec {
     plugins = with availablePlugins; [ python perl ];
   }
 }</programlisting>
+    If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal>
+    attribute, <literal>availablePlugins</literal> will be used automatically.
   </para>
 
   <para>
@@ -704,6 +706,55 @@ overrides = super: self: rec {
 }; }
 </programlisting>
   </para>
+  <para>
+    WeeChat allows to set defaults on startup using the <literal>--run-command</literal>.
+    The <literal>configure</literal> method can be used to pass commands to the program:
+<programlisting>weechat.override {
+  configure = { availablePlugins, ... }: {
+    init = ''
+      /set foo bar
+      /server add freenode chat.freenode.org
+    '';
+  };
+}</programlisting>
+    Further values can be added to the list of commands when running
+    <literal>weechat --run-command "your-commands"</literal>.
+  </para>
+  <para>
+    Additionally it's possible to specify scripts to be loaded when starting <literal>weechat</literal>.
+    These will be loaded before the commands from <literal>init</literal>:
+<programlisting>weechat.override {
+  configure = { availablePlugins, ... }: {
+    scripts = with pkgs.weechatScripts; [
+      weechat-xmpp weechat-matrix-bridge wee-slack
+    ];
+    init = ''
+      /set plugins.var.python.jabber.key "val"
+    '':
+  };
+}</programlisting>
+  </para>
+  <para>
+    In <literal>nixpkgs</literal> there's a subpackage which contains derivations for
+    WeeChat scripts. Such derivations expect a <literal>passthru.scripts</literal> attribute
+    which contains a list of all scripts inside the store path. Furthermore all scripts
+    have to live in <literal>$out/share</literal>. An exemplary derivation looks like this:
+<programlisting>{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "exemplary-weechat-script";
+  src = fetchurl {
+    url = "https://scripts.tld/your-scripts.tar.gz";
+    sha256 = "...";
+  };
+  passthru.scripts = [ "foo.py" "bar.lua" ];
+  installPhase = ''
+    mkdir $out/share
+    cp foo.py $out/share
+    cp bar.lua $out/share
+  '';
+}</programlisting>
+  </para>
  </section>
  <section xml:id="sec-citrix">
   <title>Citrix Receiver</title>