language/go: add gopher.nvim for impl, gomodifytags, iferr and ... support

This commit is contained in:
Snoweuph 2026-02-08 06:04:09 +01:00
commit d1d495c826
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
3 changed files with 61 additions and 2 deletions

View file

@ -9,8 +9,8 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe;
inherit (lib.generators) mkLuaInline;
inherit (lib.types) bool enum package;
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
inherit (lib.types) bool enum package str;
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf mkPluginSetupOption;
inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.attrsets) mapListToAttrs;
@ -231,6 +231,40 @@ in {
inherit defaultDiagnosticsProvider;
};
};
extensions = {
gopher-nvim = {
enable = mkEnableOption "Minimalistic plugin for Go development";
setupOpts = mkPluginSetupOption "gopher-nvim" {
commands = {
go = mkOption {
description = "go binary to use";
type = str;
default = "go";
};
gomodifytags = mkOption {
description = "gomodifytags binary to use";
type = str;
default = getExe pkgs.gomodifytags;
};
gotests = mkOption {
description = "gotests binary to use";
type = str;
default = getExe pkgs.gotests;
};
impl = mkOption {
description = "impl binary to use";
type = str;
default = getExe pkgs.impl;
};
iferr = mkOption {
description = "iferr binary to use";
type = str;
default = getExe pkgs.iferr;
};
};
};
};
};
};
config = mkIf cfg.enable (mkMerge [
@ -292,5 +326,14 @@ in {
cfg.extraDiagnostics.types);
};
})
(mkIf cfg.extensions.gopher-nvim.enable {
vim.lazy.plugins.gopher-nvim = {
package = "gopher-nvim";
setupModule = "gopher";
inherit (cfg.extensions.gopher-nvim) setupOpts;
ft = ["go"];
};
})
]);
}