summary refs log tree commit diff
path: root/doc/builders/packages/kakoune.xml
diff options
context:
space:
mode:
authorDaniel Gorin <jcpetruzza@gmail.com>2020-06-29 21:25:16 +0100
committerDaniel Gorin <jcpetruzza@gmail.com>2020-11-01 14:35:49 +0000
commit550389392a54a81e750aabb54b69a77c9e5d18af (patch)
treeeca9de59d139bb243092233590d4639960111408 /doc/builders/packages/kakoune.xml
parent0fb9276e51d2293f663180c233771bd38ecee932 (diff)
kakoune: rework plugin support
The previous implementation of plugin-support for the kakoune derivation
was based on generating, at build time, a `plugins.kak` file that would
source all .kak files in the list of plugins, and wrap the `kak` binary
in a script that would add some command-line arguments so that this
file gets loaded on start-up. The main problem with this approach
is that the plugins' code get executed *after* the user's configuration
file is loaded, so effectively one cannot automatically activate/configure
these plugins.

The idiomatic way of loading plugins is ensuring they end up installed
somwhere under `share/kak/autoload`. Because plugins are already being
packaged to have their code in `share/kak/autoload/plugins/<name-of-plugin>`,
we can obtain a derivation that includes the plugins simply by doing a
`symlinkJoin` of `kakoune-unwrapped` and all the requested plugins.

For this to work, we need to fix two issues:

  1. By default, kakoune makes `share/kak/autoload` a symbolic link to
     `share/kak/rc`, which contains all builtin definitions. We need
     to patch this to put the symlink under `share/kak/autoload/rc`, so that
     the join works.

  2. By default kakoune expects the `autoload` directory to be in
     `../share/kak/autoload` relative to the location of the `kak` binary.
     We need to set the `KAKOUNE_RUNTIME` to point the symlinked
     share/kak for this to work.
Diffstat (limited to 'doc/builders/packages/kakoune.xml')
-rw-r--r--doc/builders/packages/kakoune.xml4
1 files changed, 1 insertions, 3 deletions
diff --git a/doc/builders/packages/kakoune.xml b/doc/builders/packages/kakoune.xml
index 728d40dacc92f..045dbd0a653bf 100644
--- a/doc/builders/packages/kakoune.xml
+++ b/doc/builders/packages/kakoune.xml
@@ -6,9 +6,7 @@
  <para>
   Kakoune can be built to autoload plugins:
 <programlisting>(kakoune.override {
-  configure = {
-    plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
-  };
+  plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
 })</programlisting>
  </para>
 </section>