neovim-flake/modules/plugins/languages/solidity.nix
2024-12-21 14:08:17 +00:00

29 lines
625 B
Nix

{
config,
lib,
pkgs,
...
}: let
cfg = config.vim.languages.solidity;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.options) mkEnableOption;
inherit (lib.nvim) mkGrammarOption;
in {
options.vim.languages.solidity = {
enable = mkEnableOption "Solidity support";
treesitter = {
enable = mkEnableOption "Treesitter support for Solidity";
package = mkGrammarOption pkgs "solidity";
};
};
config = mkIf cfg.enable (mkMerge [
(lib.mkIf cfg.treesitter.enable {
vim.treesitter = {
enable = true;
grammars = [cfg.treesitter.package];
};
})
]);
}