mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-03 23:42:56 +00:00
Merge pull request #1403 from snoweuph/feat/go-extra
language/go: add gopher.nvim
This commit is contained in:
commit
d1aceaf41e
4 changed files with 97 additions and 3 deletions
|
|
@ -208,6 +208,9 @@
|
||||||
|
|
||||||
- Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics.
|
- Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics.
|
||||||
|
|
||||||
|
- Added [`gopher.nvim`](https://github.com/olexsmir/gopher.nvim) for extra
|
||||||
|
actions in `languages.go`.
|
||||||
|
|
||||||
- updated default filetypes for
|
- updated default filetypes for
|
||||||
[harper-ls](https://github.com/Automattic/harper) to match what they are
|
[harper-ls](https://github.com/Automattic/harper) to match what they are
|
||||||
supposed to be.
|
supposed to be.
|
||||||
|
|
|
||||||
26
flake/pkgs/by-name/json2go/package.nix
Normal file
26
flake/pkgs/by-name/json2go/package.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildGoModule,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
buildGoModule (finalAttrs: {
|
||||||
|
pname = "json2go";
|
||||||
|
version = "0.1.3";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "olexsmir";
|
||||||
|
repo = "json2go";
|
||||||
|
tag = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-2QGvPLQ7CADRNURTdnHgTCK2vyRHgtdR6YFPuTL9Ymo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
vendorHash = null;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "convert json to go type annotations";
|
||||||
|
mainProgram = "json2go";
|
||||||
|
homepage = "https://github.com/olexsmir/json2go";
|
||||||
|
license = lib.licenses.unlicense;
|
||||||
|
changelog = "${finalAttrs.meta.homepage}/releases/tag/${finalAttrs.version}";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption literalMD;
|
inherit (lib.options) mkEnableOption mkOption literalMD literalExpression;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.types) bool enum package;
|
inherit (lib.types) bool enum package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf mkPluginSetupOption;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
|
|
@ -231,6 +232,45 @@ in {
|
||||||
inherit defaultDiagnosticsProvider;
|
inherit defaultDiagnosticsProvider;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
extensions = {
|
||||||
|
gopher-nvim = {
|
||||||
|
enable = mkEnableOption "Minimalistic plugin for Go development";
|
||||||
|
setupOpts = mkPluginSetupOption "gopher-nvim" {
|
||||||
|
commands = {
|
||||||
|
go = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "go";
|
||||||
|
description = "Go binary to use";
|
||||||
|
};
|
||||||
|
gomodifytags = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = getExe pkgs.gomodifytags;
|
||||||
|
description = "gomodifytags binary to use";
|
||||||
|
};
|
||||||
|
gotests = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = getExe pkgs.gotests;
|
||||||
|
description = "gotests binary to use";
|
||||||
|
};
|
||||||
|
impl = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = getExe pkgs.impl;
|
||||||
|
description = "impl binary to use";
|
||||||
|
};
|
||||||
|
iferr = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = getExe pkgs.iferr;
|
||||||
|
description = "iferr binary to use";
|
||||||
|
};
|
||||||
|
json2go = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = literalExpression "getExe inputs.self.packages.$${pkgs.stdenv.hostPlatform.system}.json2go";
|
||||||
|
description = "json2go binary to use";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
|
@ -292,5 +332,14 @@ in {
|
||||||
cfg.extraDiagnostics.types);
|
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"];
|
||||||
|
};
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -656,6 +656,22 @@
|
||||||
"url": "https://github.com/ellisonleao/glow.nvim/archive/5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2.tar.gz",
|
"url": "https://github.com/ellisonleao/glow.nvim/archive/5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2.tar.gz",
|
||||||
"hash": "sha256-CvBcmVWBgI+m+PS7p7PmsiPtTEfqx2kpIzz4mImONIc="
|
"hash": "sha256-CvBcmVWBgI+m+PS7p7PmsiPtTEfqx2kpIzz4mImONIc="
|
||||||
},
|
},
|
||||||
|
"gopher-nvim": {
|
||||||
|
"type": "GitRelease",
|
||||||
|
"repository": {
|
||||||
|
"type": "GitHub",
|
||||||
|
"owner": "olexsmir",
|
||||||
|
"repo": "gopher.nvim"
|
||||||
|
},
|
||||||
|
"pre_releases": false,
|
||||||
|
"version_upper_bound": null,
|
||||||
|
"release_prefix": null,
|
||||||
|
"submodules": false,
|
||||||
|
"version": "v0.6.0",
|
||||||
|
"revision": "95fdeb571d837af9efae27fea1c0131fa756ab43",
|
||||||
|
"url": "https://api.github.com/repos/olexsmir/gopher.nvim/tarball/refs/tags/v0.6.0",
|
||||||
|
"hash": "sha256-7aDjMFMCiqub/zCDJIWUIX9Zc6+vyPQOczuOFdc/6S0="
|
||||||
|
},
|
||||||
"grug-far-nvim": {
|
"grug-far-nvim": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue