Skip to content

Commit

Permalink
plugons/TEMPLATE: update to use mkNeovimPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Feb 14, 2024
1 parent 4494934 commit f3e2fba
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions plugins/TEMPLATE.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,16 @@
pkgs,
...
}:
with lib; let
cfg = config.plugins.my-plugin; # TODO replace
in {
meta.maintainers = [maintainers.MyName]; # TODO replace with your name
helpers.neovim-plugin.mkNeovimPlugin config {
name = "my-plugin";
originalName = "my-plugin.nvim";
defaultPackage = pkgs.vimPlugins.my-plugin-nvim; # TODO replace

# TODO replace
options.plugins.my-plugin =
helpers.neovim-plugin.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})
'';
# Optionnally provide an example for the `settings` option.
settingsExample = {
foo = 42;
bar.__raw = "function() print('hello') end";
};

maintainers = [lib.maintainers.MyName]; # TODO replace with your name
}

0 comments on commit f3e2fba

Please sign in to comment.