Files
nixpkgs/pkgs/by-name/go/gopls/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

57 lines
1.6 KiB
Nix

{
lib,
# gopls breaks if it is compiled with a lower version than the one it is running against.
# This will affect users especially when project they work on bump go minor version before
# the update went through nixpkgs staging. Further, gopls is a central ecosystem component.
buildGoLatestModule,
fetchFromGitHub,
nix-update-script,
versionCheckHook,
}:
buildGoLatestModule (finalAttrs: {
pname = "gopls";
version = "0.20.0";
src = fetchFromGitHub {
owner = "golang";
repo = "tools";
tag = "gopls/v${finalAttrs.version}";
hash = "sha256-DYYitsrdH4nujDFJgdkObEpgElhXI7Yk2IpA/EVVLVo=";
};
modRoot = "gopls";
vendorHash = "sha256-J6QcefSs4XtnktlzG+/+aY6fqkHGd9MMZqi24jAwcd0=";
# https://github.com/golang/tools/blob/9ed98faa/gopls/main.go#L27-L30
ldflags = [ "-X main.version=v${finalAttrs.version}" ];
doCheck = false;
# Only build gopls & modernize, not the integration tests or documentation generator.
subPackages = [
"."
"internal/analysis/modernize/cmd/modernize"
];
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "version";
passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=gopls/(.*)" ]; };
meta = {
changelog = "https://github.com/golang/tools/releases/tag/gopls/v${finalAttrs.version}";
description = "Official language server for the Go language";
homepage = "https://github.com/golang/tools/tree/master/gopls";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
mic92
rski
SuperSandro2000
zimbatm
];
mainProgram = "gopls";
};
})