flake: build Go-parsing tools with the project's Go

goimports, gotools' goimports wrapper and golangci-lint-langserver were
on the nixpkgs default Go, whose parser rejects generic methods.
This commit is contained in:
Kristoffer Dalby authored and Kristoffer Dalby committed 2026-08-25 21:59:00 +02:00
1 parent 941fd9ff4e
commit 820dc3001b
1 file changed
+14
+14
View File
@@ -82,6 +82,18 @@
golines = prev.golines.override {
buildGoModule = buildGo;
};
# goimports and friends: they parse Go with the parser of the Go
# they were built with, so an older one rejects new syntax.
gotools = prev.gotools.override {
buildGoModule = buildGo;
# goimports is wrapped with this go on PATH for module lookups.
go = pkgs.go_latest;
};
golangci-lint-langserver = prev.golangci-lint-langserver.override {
buildGoModule = buildGo;
};
};
}
// flake-utils.lib.eachDefaultSystem
@@ -106,6 +118,8 @@
gotests
gofumpt
gopls
gotools
ksh
ko
yq-go