nixpkgs/pkgs/by-name/se/secretscanner/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

60 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, hyperscan
, pkg-config
, protobuf
, protoc-gen-go
, protoc-gen-go-grpc
}:
buildGoModule rec {
pname = "secretscanner";
version = "1.2.0";
src = fetchFromGitHub {
owner = "deepfence";
repo = "SecretScanner";
rev = "refs/tags/v${version}";
fetchSubmodules = true;
hash = "sha256-lTUZLuEiC9xpHYWn3uv4ZtbvHX6ETsjxacjd/O0kU8I=";
};
vendorHash = "sha256-lB+fiSdflIYGw0hMN0a9IOtRcJwYEUPQqaeU7mAfSQs=";
excludedPackages = [
"./agent-plugins-grpc/proto" # No need to build submodules
];
nativeBuildInputs = [
pkg-config
protobuf
protoc-gen-go
protoc-gen-go-grpc
];
buildInputs = [
hyperscan
];
preBuild = ''
# Compile proto files
make -C agent-plugins-grpc go
'';
postInstall = ''
mv $out/bin/SecretScanner $out/bin/$pname
'';
meta = with lib; {
description = "Tool to find secrets and passwords in container images and file systems";
mainProgram = "secretscanner";
homepage = "https://github.com/deepfence/SecretScanner";
changelog = "https://github.com/deepfence/SecretScanner/releases/tag/v${version}";
platforms = [ "x86_64-linux" ];
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}