From d0fe03881d2b0507e6792216822e342ebbb2b535 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Thu, 20 Jun 2024 19:37:17 +0100 Subject: [PATCH] poutine: add shell completions --- pkgs/by-name/po/poutine/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/po/poutine/package.nix b/pkgs/by-name/po/poutine/package.nix index 617454ae468e..6ebd925ff2eb 100644 --- a/pkgs/by-name/po/poutine/package.nix +++ b/pkgs/by-name/po/poutine/package.nix @@ -1,7 +1,9 @@ { lib, + stdenv, buildGoModule, fetchFromGitHub, + installShellFiles, }: buildGoModule rec { @@ -22,6 +24,15 @@ buildGoModule rec { "-w" ]; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd ${meta.mainProgram} \ + --bash <($out/bin/${meta.mainProgram} completion bash) \ + --fish <($out/bin/${meta.mainProgram} completion fish) \ + --zsh <($out/bin/${meta.mainProgram} completion zsh) + ''; + meta = with lib; { description = "Security scanner that detects misconfigurations and vulnerabilities in build pipelines of repositories"; homepage = "https://github.com/boostsecurityio/poutine";