lib/neovim-plugin: Add lua configuration scoped to the plugin

This commit adds a `plugins.<name>.luaConfig` section controlling the
plugin specific configuration.

The section contains the internal `init` option, containing the plugin's
initialization code.

It also contains the public `pre` and `post` options, that allow to add
code before & after the `init` section

Finally, it contains the `final` option, being the concatenation of the
three previous options.
This commit is contained in:
Quentin Boyer 2024-08-19 23:31:57 +02:00 committed by nix-infra-bot
parent 2bc6a94992
commit d2f9e011d9
21 changed files with 129 additions and 35 deletions

View file

@ -246,7 +246,7 @@ helpers.neovim-plugin.mkNeovimPlugin {
# ccc requires `termguicolors` to be enabled.
opts.termguicolors = lib.mkDefault true;
extraConfigLua = ''
plugins.ccc.luaConfig.content = ''
ccc = require('ccc')
ccc.setup(${helpers.toLuaObject cfg.settings})
'';