diff --git a/modules/languages/default.nix b/modules/languages/default.nix index 3aa9da9..3da3f16 100644 --- a/modules/languages/default.nix +++ b/modules/languages/default.nix @@ -9,19 +9,22 @@ with lib; let in { imports = [ + ./bash.nix ./clang.nix ./go.nix + ./html.nix + ./java.nix + ./kotlin.nix + ./markdown.nix ./nix.nix + ./plantuml.nix ./python.nix ./rust.nix ./sql.nix + ./terraform.nix + ./tidal.nix ./ts.nix ./zig.nix - ./markdown.nix - ./plantuml.nix - ./tidal.nix - ./html.nix - ./bash.nix ]; options.vim.languages = { diff --git a/modules/languages/java.nix b/modules/languages/java.nix new file mode 100644 index 0000000..9052632 --- /dev/null +++ b/modules/languages/java.nix @@ -0,0 +1,29 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.languages.java; +in { + options.vim.languages.java = { + enable = mkEnableOption "Java language support"; + + treesitter = { + enable = mkOption { + description = "Enable Java treesitter"; + type = types.bool; + default = config.vim.languages.enableTreesitter; + }; + package = nvim.options.mkGrammarOption pkgs "java"; + }; + }; + config = mkIf cfg.enable (mkMerge [ + (mkIf cfg.treesitter.enable { + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.package]; + }) + ]); +} diff --git a/modules/languages/kotlin.nix b/modules/languages/kotlin.nix new file mode 100644 index 0000000..307a0e2 --- /dev/null +++ b/modules/languages/kotlin.nix @@ -0,0 +1,29 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.languages.kotlin; +in { + options.vim.languages.kotlin = { + enable = mkEnableOption "Kotlin language support"; + + treesitter = { + enable = mkOption { + description = "Enable kotlin treesitter"; + type = types.bool; + default = config.vim.languages.enableTreesitter; + }; + package = nvim.options.mkGrammarOption pkgs "kotlin"; + }; + }; + config = mkIf cfg.enable (mkMerge [ + (mkIf cfg.treesitter.enable { + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.package]; + }) + ]); +} diff --git a/modules/languages/terraform.nix b/modules/languages/terraform.nix new file mode 100644 index 0000000..9cd3084 --- /dev/null +++ b/modules/languages/terraform.nix @@ -0,0 +1,29 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.languages.terraform; +in { + options.vim.languages.terraform = { + enable = mkEnableOption "Terraform language support"; + + treesitter = { + enable = mkOption { + description = "Enable terraform treesitter"; + type = types.bool; + default = config.vim.languages.enableTreesitter; + }; + package = nvim.options.mkGrammarOption pkgs "terraform"; + }; + }; + config = mkIf cfg.enable (mkMerge [ + (mkIf cfg.treesitter.enable { + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.package]; + }) + ]); +}