mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins: add a sensible template for modern plugins
This commit is contained in:
parent
2bcdcfafe5
commit
f2e808a519
1 changed files with 34 additions and 0 deletions
34
plugins/TEMPLATE.nix
Normal file
34
plugins/TEMPLATE.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
helpers,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.plugins.my-plugin; # TODO replace
|
||||||
|
in {
|
||||||
|
meta.maintainers = [maintainers.MyName]; # TODO replace with your name
|
||||||
|
|
||||||
|
# TODO replace
|
||||||
|
options.plugins.my-plugin =
|
||||||
|
helpers.extraOptionsOptions
|
||||||
|
// {
|
||||||
|
enable = mkEnableOption "my-plugin.nvim"; # TODO replace
|
||||||
|
|
||||||
|
package = helpers.mkPackageOption "my-plugin.nvim" pkgs.vimPlugins.my-plugin-nvim; # TODO replace
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
|
extraConfigLua = let
|
||||||
|
setupOptions = with cfg;
|
||||||
|
{
|
||||||
|
}
|
||||||
|
// cfg.extraOptions;
|
||||||
|
in ''
|
||||||
|
require('my-plugin').setup(${helpers.toLuaObject setupOptions})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue