mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-03 23:42:56 +00:00
languages/go: cleanup; add defaultText for non-primitive defaults
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ibd01b64851f1b5800cf917f97e9be4fa6a6a6964
This commit is contained in:
parent
d1aceaf41e
commit
750dbfaf6e
1 changed files with 53 additions and 20 deletions
|
|
@ -65,9 +65,11 @@
|
||||||
gofmt = {
|
gofmt = {
|
||||||
command = "${pkgs.go}/bin/gofmt";
|
command = "${pkgs.go}/bin/gofmt";
|
||||||
};
|
};
|
||||||
|
|
||||||
gofumpt = {
|
gofumpt = {
|
||||||
command = getExe pkgs.gofumpt;
|
command = getExe pkgs.gofumpt;
|
||||||
};
|
};
|
||||||
|
|
||||||
golines = {
|
golines = {
|
||||||
command = "${pkgs.golines}/bin/golines";
|
command = "${pkgs.golines}/bin/golines";
|
||||||
};
|
};
|
||||||
|
|
@ -169,7 +171,12 @@ in {
|
||||||
enable = mkEnableOption "Go language support";
|
enable = mkEnableOption "Go language support";
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = mkEnableOption "Go treesitter" // {default = config.vim.languages.enableTreesitter;};
|
enable =
|
||||||
|
mkEnableOption "Go treesitter"
|
||||||
|
// {
|
||||||
|
default = config.vim.languages.enableTreesitter;
|
||||||
|
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||||
|
};
|
||||||
|
|
||||||
goPackage = mkGrammarOption pkgs "go";
|
goPackage = mkGrammarOption pkgs "go";
|
||||||
gomodPackage = mkGrammarOption pkgs "gomod";
|
gomodPackage = mkGrammarOption pkgs "gomod";
|
||||||
|
|
@ -179,7 +186,12 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Go LSP support" // {default = config.vim.lsp.enable;};
|
enable =
|
||||||
|
mkEnableOption "Go LSP support"
|
||||||
|
// {
|
||||||
|
default = config.vim.lsp.enable;
|
||||||
|
defaultText = literalExpression "config.vim.lsp.enable";
|
||||||
|
};
|
||||||
|
|
||||||
servers = mkOption {
|
servers = mkOption {
|
||||||
type = deprecatedSingleOrListOf "vim.language.go.lsp.servers" (enum (attrNames servers));
|
type = deprecatedSingleOrListOf "vim.language.go.lsp.servers" (enum (attrNames servers));
|
||||||
|
|
@ -199,39 +211,48 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
description = "Go formatter to use";
|
|
||||||
type = deprecatedSingleOrListOf "vim.language.go.format.type" (enum (attrNames formats));
|
type = deprecatedSingleOrListOf "vim.language.go.format.type" (enum (attrNames formats));
|
||||||
default = defaultFormat;
|
default = defaultFormat;
|
||||||
|
description = "Go formatter to use";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
dap = {
|
dap = {
|
||||||
enable = mkOption {
|
enable =
|
||||||
description = "Enable Go Debug Adapter via nvim-dap-go plugin";
|
mkEnableOption "Go Debug Adapter (DAP) via `nvim-dap-go"
|
||||||
type = bool;
|
// {
|
||||||
default = config.vim.languages.enableDAP;
|
default = config.vim.languages.enableDAP;
|
||||||
};
|
defaultText = literalExpression "config.vim.languages.enableDAP";
|
||||||
|
};
|
||||||
|
|
||||||
debugger = mkOption {
|
debugger = mkOption {
|
||||||
description = "Go debugger to use";
|
|
||||||
type = enum (attrNames debuggers);
|
type = enum (attrNames debuggers);
|
||||||
default = defaultDebugger;
|
default = defaultDebugger;
|
||||||
|
description = "Go debugger to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Go debugger package.";
|
|
||||||
type = package;
|
type = package;
|
||||||
default = debuggers.${cfg.dap.debugger}.package;
|
default = debuggers.${cfg.dap.debugger}.package;
|
||||||
|
description = "Go debugger package.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extraDiagnostics = {
|
extraDiagnostics = {
|
||||||
enable = mkEnableOption "extra Go diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
enable =
|
||||||
|
mkEnableOption "extra Go diagnostics"
|
||||||
|
// {
|
||||||
|
default = config.vim.languages.enableExtraDiagnostics;
|
||||||
|
defaultText = literalExpression "config.vim.languages.enableExtraDiagnostic";
|
||||||
|
};
|
||||||
|
|
||||||
types = diagnostics {
|
types = diagnostics {
|
||||||
langDesc = "Go";
|
langDesc = "Go";
|
||||||
inherit diagnosticsProviders;
|
inherit diagnosticsProviders;
|
||||||
inherit defaultDiagnosticsProvider;
|
inherit defaultDiagnosticsProvider;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extensions = {
|
extensions = {
|
||||||
gopher-nvim = {
|
gopher-nvim = {
|
||||||
enable = mkEnableOption "Minimalistic plugin for Go development";
|
enable = mkEnableOption "Minimalistic plugin for Go development";
|
||||||
|
|
@ -242,29 +263,39 @@ in {
|
||||||
default = "go";
|
default = "go";
|
||||||
description = "Go binary to use";
|
description = "Go binary to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
gomodifytags = mkOption {
|
gomodifytags = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = getExe pkgs.gomodifytags;
|
default = getExe pkgs.gomodifytags;
|
||||||
|
defaultText = literalExpression "getExe pkgs.gomodifytags";
|
||||||
description = "gomodifytags binary to use";
|
description = "gomodifytags binary to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
gotests = mkOption {
|
gotests = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = getExe pkgs.gotests;
|
default = getExe pkgs.gotests;
|
||||||
|
defaultText = literalExpression "getExe pkgs.gotests";
|
||||||
description = "gotests binary to use";
|
description = "gotests binary to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
impl = mkOption {
|
impl = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = getExe pkgs.impl;
|
default = getExe pkgs.impl;
|
||||||
|
defaultText = literalExpression "getExe pkgs.impl";
|
||||||
description = "impl binary to use";
|
description = "impl binary to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
iferr = mkOption {
|
iferr = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = getExe pkgs.iferr;
|
default = getExe pkgs.iferr;
|
||||||
|
defaultText = literalExpression "getExe pkgs.iferr";
|
||||||
description = "iferr binary to use";
|
description = "iferr binary to use";
|
||||||
};
|
};
|
||||||
|
|
||||||
json2go = mkOption {
|
json2go = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = literalExpression "getExe inputs.self.packages.$${pkgs.stdenv.hostPlatform.system}.json2go";
|
default = getExe inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.json2go;
|
||||||
|
defaultText = literalExpression "getExe inputs.self.packages.$${pkgs.stdenv.hostPlatform.system}.json2go";
|
||||||
description = "json2go binary to use";
|
description = "json2go binary to use";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -275,14 +306,16 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
vim.treesitter.enable = true;
|
vim.treesitter = {
|
||||||
vim.treesitter.grammars = [
|
enable = true;
|
||||||
cfg.treesitter.goPackage
|
grammars = [
|
||||||
cfg.treesitter.gomodPackage
|
cfg.treesitter.goPackage
|
||||||
cfg.treesitter.gosumPackage
|
cfg.treesitter.gomodPackage
|
||||||
cfg.treesitter.goworkPackage
|
cfg.treesitter.gosumPackage
|
||||||
cfg.treesitter.gotmplPackage
|
cfg.treesitter.goworkPackage
|
||||||
];
|
cfg.treesitter.gotmplPackage
|
||||||
|
];
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue