diff --git a/plugins/TEMPLATE.nix b/plugins/TEMPLATE.nix new file mode 100644 index 00000000..d20e952f --- /dev/null +++ b/plugins/TEMPLATE.nix @@ -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}) + ''; + }; +}