Files
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

67 lines
1.8 KiB
Nix

{
# golangci-lint has historically required code changes to support new versions of
# go so always use the latest specific go version that golangci-lint supports
# rather than buildGoLatestModule.
# This can be bumped when the release notes of golangci-lint detail support for
# new version of go.
buildGo125Module,
buildPackages,
fetchFromGitHub,
installShellFiles,
lib,
stdenv,
}:
buildGo125Module (finalAttrs: {
pname = "golangci-lint";
version = "2.5.0";
src = fetchFromGitHub {
owner = "golangci";
repo = "golangci-lint";
tag = "v${finalAttrs.version}";
hash = "sha256-7dHr7cd+yYofIb+yR2kKfj0k0onLH2W/YuxNor7zPeo=";
};
vendorHash = "sha256-QEYbFz7SJxLMblkNqaRLDn/PO+mtSPvNYiEUmZh0sLQ=";
subPackages = [ "cmd/golangci-lint" ];
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X main.version=${finalAttrs.version}"
"-X main.commit=v${finalAttrs.version}"
"-X main.date=1970-01-01T00:00:00Z"
];
postInstall =
let
golangcilintBin =
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
"$out"
else
lib.getBin buildPackages.golangci-lint;
in
''
installShellCompletion --cmd golangci-lint \
--bash <(${golangcilintBin}/bin/golangci-lint completion bash) \
--fish <(${golangcilintBin}/bin/golangci-lint completion fish) \
--zsh <(${golangcilintBin}/bin/golangci-lint completion zsh)
'';
meta = {
description = "Fast linters Runner for Go";
homepage = "https://golangci-lint.run/";
changelog = "https://github.com/golangci/golangci-lint/blob/v${finalAttrs.version}/CHANGELOG.md";
mainProgram = "golangci-lint";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
SuperSandro2000
mic92
];
};
})