Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Languages (java,kotlin,terraform): add treesitter options #48

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions modules/languages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
29 changes: 29 additions & 0 deletions modules/languages/java.nix
Original file line number Diff line number Diff line change
@@ -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];
})
]);
}
29 changes: 29 additions & 0 deletions modules/languages/kotlin.nix
Original file line number Diff line number Diff line change
@@ -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];
})
]);
}
29 changes: 29 additions & 0 deletions modules/languages/terraform.nix
Original file line number Diff line number Diff line change
@@ -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];
})
]);
}