From 5b14e87eca460f123e9f371e2243409b299d4c38 Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 19 May 2023 12:00:31 -0400 Subject: [PATCH 1/2] threatest: fix build on darwin --- pkgs/tools/security/threatest/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/threatest/default.nix b/pkgs/tools/security/threatest/default.nix index f4ddc194b0e7..13c54060529a 100644 --- a/pkgs/tools/security/threatest/default.nix +++ b/pkgs/tools/security/threatest/default.nix @@ -14,7 +14,8 @@ buildGoModule rec { hash = "sha256-xluKQXFa06ng9bs+sBkoFLeyYtQAcej4VFLMeTST6zA="; }; - vendorHash = "sha256-tvGmSpihGwpz6TCmbttz0VKvLTChDRWNX3qxOhEpdPM="; + proxyVendor = true; + vendorHash = "sha256-UQ3GPSv7P4+oMvcu4eFlosnw0TQxG33ptlMTQA/5Lkw="; meta = with lib; { description = "Framework for end-to-end testing threat detection rules"; From f4e18158002adaa094b3e22268662df9ecc0b769 Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 19 May 2023 12:04:55 -0400 Subject: [PATCH 2/2] threatest: install shell completions --- pkgs/tools/security/threatest/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/tools/security/threatest/default.nix b/pkgs/tools/security/threatest/default.nix index 13c54060529a..e32ffb52bd04 100644 --- a/pkgs/tools/security/threatest/default.nix +++ b/pkgs/tools/security/threatest/default.nix @@ -1,6 +1,7 @@ { lib , buildGoModule , fetchFromGitHub +, installShellFiles }: buildGoModule rec { @@ -17,6 +18,17 @@ buildGoModule rec { proxyVendor = true; vendorHash = "sha256-UQ3GPSv7P4+oMvcu4eFlosnw0TQxG33ptlMTQA/5Lkw="; + nativeBuildInputs = [ + installShellFiles + ]; + + postInstall = '' + installShellCompletion --cmd threatest \ + --bash <($out/bin/threatest completion bash) \ + --fish <($out/bin/threatest completion fish) \ + --zsh <($out/bin/threatest completion zsh) + ''; + meta = with lib; { description = "Framework for end-to-end testing threat detection rules"; homepage = "https://github.com/DataDog/threatest";