diff --git a/docs/docs.go b/docs/docs.go index 034ddd7b45..e6d66eeedc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -3,5 +3,6 @@ package docs import "embed" // Docs embed docs static files -// go:embed static +// +//go:embed static var Docs embed.FS diff --git a/nix/build_overlay.nix b/nix/build_overlay.nix index 2870eae80e..1904555195 100644 --- a/nix/build_overlay.nix +++ b/nix/build_overlay.nix @@ -1,4 +1,5 @@ # some basic overlays necessary for the build final: super: { rocksdb = final.callPackage ./rocksdb.nix { }; + golangci-lint = final.callPackage ./golangci-lint.nix { }; } diff --git a/nix/golangci-lint.nix b/nix/golangci-lint.nix new file mode 100644 index 0000000000..5516d8f581 --- /dev/null +++ b/nix/golangci-lint.nix @@ -0,0 +1,43 @@ +{ buildGo123Module, fetchFromGitHub, lib, installShellFiles }: + +buildGo123Module rec { + pname = "golangci-lint"; + version = "1.60.1"; + + src = fetchFromGitHub { + owner = "golangci"; + repo = "golangci-lint"; + rev = "v${version}"; + hash = "sha256-+F/t5UJjyqOsabi2J4M9g5JvAqfKjOvlzdhNozRCv70="; + }; + + vendorHash = "sha256-elDDSAeEpKXn6fhBFB218mWsSq0mo+GcfQsTDOAPSCI="; + + subPackages = [ "cmd/golangci-lint" ]; + + nativeBuildInputs = [ installShellFiles ]; + + ldflags = [ + "-s" + "-w" + "-X main.version=${version}" + "-X main.commit=v${version}" + "-X main.date=19700101-00:00:00" + ]; + + postInstall = '' + for shell in bash zsh fish; do + HOME=$TMPDIR $out/bin/golangci-lint completion $shell > golangci-lint.$shell + installShellCompletion golangci-lint.$shell + done + ''; + + meta = with lib; { + description = "Fast linters Runner for Go"; + homepage = "https://golangci-lint.run/"; + changelog = "https://github.com/golangci/golangci-lint/blob/v${version}/CHANGELOG.md"; + mainProgram = "golangci-lint"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ SuperSandro2000 mic92 ]; + }; +} \ No newline at end of file