plugins/hmts: add warning when treesitter is not enabled

This commit is contained in:
Gaetan Lepage 2024-01-26 15:33:09 +01:00 committed by Gaétan Lepage
parent 889144c0b1
commit d137555971
2 changed files with 13 additions and 12 deletions

View file

@ -8,15 +8,19 @@
with lib; let with lib; let
cfg = config.plugins.hmts; cfg = config.plugins.hmts;
in { in {
options.plugins.hmts = meta.maintainers = [maintainers.GaetanLepage];
helpers.extraOptionsOptions
// {
enable = mkEnableOption "hmts.nvim";
package = helpers.mkPackageOption "hmts.nvim" pkgs.vimPlugins.hmts-nvim; options.plugins.hmts = {
}; enable = mkEnableOption "hmts.nvim";
package = helpers.mkPackageOption "hmts.nvim" pkgs.vimPlugins.hmts-nvim;
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
warnings = optional (!config.plugins.treesitter.enable) [
"Nixvim: treesitter-refactor needs treesitter to function as intended"
];
extraPlugins = [cfg.package]; extraPlugins = [cfg.package];
}; };
} }

View file

@ -1,11 +1,8 @@
{ {
empty = { empty = {
plugins.hmts.enable = true; plugins = {
}; hmts.enable = true;
treesitter.enable = true;
example = {
plugins.hmts = {
enable = true;
}; };
}; };
} }