btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / th / threatest / package.nix
blob88427627938bc42492eb9ecc12f6f8b00c303172
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 }:
7 buildGoModule rec {
8   pname = "threatest";
9   version = "1.2.5";
11   src = fetchFromGitHub {
12     owner = "DataDog";
13     repo = pname;
14     rev = "refs/tags/v${version}";
15     hash = "sha256-rVRBrf/RTcHvKOLHNASzvij3fV+uQEuIVKb07CZ/cT0=";
16   };
18   proxyVendor = true;
19   vendorHash = "sha256-EvVazz51sW8z+8XfZB0Xo42KuUT6Q9n2Y/0HvlF1bV4=";
21   nativeBuildInputs = [
22     installShellFiles
23   ];
25   postInstall = ''
26     installShellCompletion --cmd threatest \
27       --bash <($out/bin/threatest completion bash) \
28       --fish <($out/bin/threatest completion fish) \
29       --zsh <($out/bin/threatest completion zsh)
30   '';
32   meta = with lib; {
33     description = "Framework for end-to-end testing threat detection rules";
34     mainProgram = "threatest";
35     homepage = "https://github.com/DataDog/threatest";
36     changelog = "https://github.com/DataDog/threatest/releases/tag/v${version}";
37     license = licenses.asl20;
38     maintainers = with maintainers; [ fab ];
39   };