nix-community.nixvim/plugins/utils/hydra/default.nix
Matt Sturgeon 1fd4b6c739
plugins: migrate defaultPackage -> package
Migrate all users of `mkVimPlugin` and `mkNeovimPlugin` to use the new
`package` argument instead of the old `defaultPackage` argument.
2024-09-04 03:29:34 +01:00

50 lines
992 B
Nix

{
lib,
helpers,
...
}:
with lib;
helpers.neovim-plugin.mkNeovimPlugin {
name = "hydra";
originalName = "hydra.nvim";
package = "hydra-nvim";
maintainers = [ maintainers.GaetanLepage ];
extraOptions = {
# A list of `Hydra` definitions
hydras = import ./hydras-option.nix { inherit lib helpers; };
};
settingsOptions = import ./hydra-config-opts.nix { inherit lib helpers; };
settingsExample = {
exit = false;
foreign_keys = "run";
color = "red";
buffer = true;
invoke_on_body = false;
desc = null;
on_enter = ''
function()
print('hello')
end
'';
timeout = 5000;
hint = false;
};
callSetup = false;
extraConfig = cfg: {
extraConfigLua = ''
hydra = require('hydra')
hydra.setup(${helpers.toLuaObject cfg.settings})
__hydra_defs = ${helpers.toLuaObject cfg.hydras}
for _, hydra_config in ipairs(__hydra_defs) do
hydra(hydra_config)
end
'';
};
}