nix-community.nixvim/plugins/languages/treesitter/ts-context-commentstring.nix

38 lines
833 B
Nix
Raw Normal View History

{
pkgs,
lib,
config,
...
}:
with lib; let
helpers = import ../../helpers.nix {inherit lib;};
in {
options.plugins.ts-context-commentstring =
helpers.extraOptionsOptions
// {
enable = mkEnableOption "nvim-ts-context-commentstring";
package =
helpers.mkPackageOption
"ts-context-commentstring"
pkgs.vimPlugins.nvim-ts-context-commentstring;
};
config = let
cfg = config.plugins.ts-context-commentstring;
in
mkIf cfg.enable {
warnings = mkIf (!config.plugins.treesitter.enable) [
"Nixvim: ts-context-commentstring needs treesitter to function as intended"
];
extraPlugins = [cfg.package];
plugins.treesitter.moduleConfig.context_commentstring =
{
enable = true;
}
// cfg.extraOptions;
};
}