Skip to content

Commit

Permalink
add golangci-lint overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 28, 2024
1 parent c7717ce commit 866d28a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ package docs
import "embed"

// Docs embed docs static files
// go:embed static
//
//go:embed static
var Docs embed.FS
1 change: 1 addition & 0 deletions nix/build_overlay.nix
Original file line number Diff line number Diff line change
@@ -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 { };
}
43 changes: 43 additions & 0 deletions nix/golangci-lint.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}

0 comments on commit 866d28a

Please sign in to comment.