nix-community.nixvim/plugins/by-name/hydra/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1,011 B
Nix
Raw Normal View History

2024-04-22 13:29:58 +02:00
{
lib,
helpers,
...
}:
with lib;
2024-12-22 09:58:27 +00:00
lib.nixvim.plugins.mkNeovimPlugin {
2024-04-22 13:29:58 +02:00
name = "hydra";
packPathName = "hydra.nvim";
package = "hydra-nvim";
2024-04-22 13:29:58 +02:00
maintainers = [ maintainers.GaetanLepage ];
extraOptions = {
# A list of `Hydra` definitions
hydras = import ./hydras-option.nix { inherit lib helpers; };
};
2024-09-04 17:14:16 +01:00
settingsOptions = import ./settings-options.nix { inherit lib helpers; };
2024-04-22 13:29:58 +02:00
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: {
plugins.hydra.luaConfig.content = ''
2024-04-22 13:29:58 +02:00
hydra = require('hydra')
hydra.setup(${lib.nixvim.toLuaObject cfg.settings})
2024-04-22 13:29:58 +02:00
__hydra_defs = ${lib.nixvim.toLuaObject cfg.hydras}
2024-04-22 13:29:58 +02:00
for _, hydra_config in ipairs(__hydra_defs) do
hydra(hydra_config)
end
'';
};
}