1 { lib, symlinkJoin, makeWrapper, kakoune, plugins ? [], configure ? {} }:
4 # "plugins" is the preferred way, but some configurations may be
5 # using "configure.plugins", so accept both
6 requestedPlugins = plugins ++ (configure.plugins or []);
10 name = "kakoune-${kakoune.version}";
12 nativeBuildInputs = [ makeWrapper ];
14 paths = [ kakoune ] ++ requestedPlugins;
17 # create a directory for bins that kakoune needs
18 # access to, without polluting the users path by adding
19 # that binary nested with this symlinkJoin.
20 mkdir -p $out/share/kak/bin
22 # location of kak binary is used to find ../share/kak/autoload,
23 # unless explicitly overriden with KAKOUNE_RUNTIME
25 makeWrapper "${kakoune}/bin/kak" "$out/bin/kak" \
26 --set KAKOUNE_RUNTIME "$out/share/kak" \
27 --suffix PATH : "$out/share/kak/bin"
29 # currently kakoune ignores doc files if they are symlinks, so workaround by
30 # copying doc files over, so they become regular files...
31 mkdir "$out/DELETE_ME"
32 mv "$out/share/kak/doc" "$out/DELETE_ME"
33 cp -r --dereference "$out/DELETE_ME/doc" "$out/share/kak"
34 rm -Rf "$out/DELETE_ME"
37 meta = kakoune.meta // { priority = (kakoune.meta.priority or lib.meta.defaultPriority) - 1; };