about summary refs log tree commit diff
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-05-19 12:04:55 -0400
committerfigsoda <figsoda@pm.me>2023-05-19 12:07:43 -0400
commitf4e18158002adaa094b3e22268662df9ecc0b769 (patch)
treeab2b0d4feabe8abf97875d0ff4bc0f0bef23c3d5
parent5b14e87eca460f123e9f371e2243409b299d4c38 (diff)
threatest: install shell completions
-rw-r--r--pkgs/tools/security/threatest/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/tools/security/threatest/default.nix b/pkgs/tools/security/threatest/default.nix
index 13c54060529ae..e32ffb52bd046 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";