languages/java: add extension maven.nvim

This commit is contained in:
Snoweuph 2026-04-20 23:49:31 +02:00
commit b00e829594
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
3 changed files with 52 additions and 2 deletions

View file

@ -383,6 +383,9 @@
- Extend `languages.asm` to support more filetypes out of the box.
- Added {option}`vim.languages.java.extensions.maven-nvim.enable` for Maven
support;
- Didn't Add
[`syntax-gaslighting`](https://github.com/NotAShelf/syntax-gaslighting.nvim),
you're crazy.

View file

@ -7,8 +7,9 @@
inherit (lib.options) literalExpression mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge;
inherit (lib) genAttrs;
inherit (lib.types) listOf;
inherit (lib.nvim.types) mkGrammarOption enumWithRename;
inherit (lib.types) listOf str;
inherit (lib.meta) getExe;
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption enumWithRename;
cfg = config.vim.languages.java;
@ -46,6 +47,26 @@ in {
description = "Java LSP server to use";
};
};
extensions = {
maven-nvim = {
enable = mkEnableOption "maven integration";
setupOpts = mkPluginSetupOption "maven-nvim" {
mvn_executable = mkOption {
type = str;
default = getExe pkgs.maven;
defaultText = literalExpression "getExe pkgs.maven";
description = ''
The maven executable to use.
'';
example = ''
- `"mvn"`: to use the maven from the `PATH`.
- `"./mvnw"`: to use the projects maven.
- `"$${getExe pkgs.maven}"`: to use maven from a nix package.
'';
};
};
};
};
};
config = mkIf cfg.enable (mkMerge [
@ -62,5 +83,18 @@ in {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package];
})
(mkIf cfg.extensions.maven-nvim.enable {
vim = mkMerge [
{
startPlugins = ["nui-nvim" "plenary-nvim"];
lazy.plugins.maven-nvim = {
package = "maven-nvim";
setupModule = "maven";
setupOpts = cfg.extensions.maven-nvim.setupOpts;
};
}
];
})
]);
}

View file

@ -1063,6 +1063,19 @@
"url": "https://github.com/OXY2DEV/markview.nvim/archive/1861f959599ae03cfd59f56222a542035b0cd947.tar.gz",
"hash": "sha256-T6ZVy7o9sSGa2vOolvmL7KO3cXkyEwJ9F4n6BbWdPGk="
},
"maven-nvim": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "oclay1st",
"repo": "maven.nvim"
},
"branch": "main",
"submodules": false,
"revision": "8d53fe5d5e4b0417c1e923f1c44f769192435411",
"url": "https://github.com/oclay1st/maven.nvim/archive/8d53fe5d5e4b0417c1e923f1c44f769192435411.tar.gz",
"hash": "sha256-fzen+eJtenvnxRPWXHnnmp+r1g2iaEFOEYUPblViroY="
},
"mellow": {
"type": "Git",
"repository": {