btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / se / secretscanner / package.nix
blobdb23b87058f418ca831bce41ba8ed080be75403a
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , hyperscan
5 , pkg-config
6 , protobuf
7 , protoc-gen-go
8 , protoc-gen-go-grpc
9 }:
11 buildGoModule rec {
12   pname = "secretscanner";
13   version = "1.2.0";
15   src = fetchFromGitHub {
16     owner = "deepfence";
17     repo = "SecretScanner";
18     rev = "refs/tags/v${version}";
19     fetchSubmodules = true;
20     hash = "sha256-lTUZLuEiC9xpHYWn3uv4ZtbvHX6ETsjxacjd/O0kU8I=";
21   };
23   vendorHash = "sha256-lB+fiSdflIYGw0hMN0a9IOtRcJwYEUPQqaeU7mAfSQs=";
25   excludedPackages = [
26     "./agent-plugins-grpc/proto" # No need to build submodules
27   ];
29   nativeBuildInputs = [
30     pkg-config
31     protobuf
32     protoc-gen-go
33     protoc-gen-go-grpc
34   ];
36   buildInputs = [
37     hyperscan
38   ];
40   preBuild = ''
41     # Compile proto files
42     make -C agent-plugins-grpc go
43   '';
45   postInstall = ''
46     mv $out/bin/SecretScanner $out/bin/$pname
47   '';
49   meta = with lib; {
50     description = "Tool to find secrets and passwords in container images and file systems";
51     mainProgram = "secretscanner";
52     homepage = "https://github.com/deepfence/SecretScanner";
53     changelog = "https://github.com/deepfence/SecretScanner/releases/tag/v${version}";
54     platforms = [ "x86_64-linux" ];
55     license = with licenses; [ mit ];
56     maintainers = with maintainers; [ fab ];
57   };