From a0b7f2b52f3a421f55a6c023cb6c232b5f00259c Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 8 Jul 2024 11:20:15 +0200 Subject: [PATCH] gitleaks: only generate shell completions if possible --- pkgs/tools/security/gitleaks/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/gitleaks/default.nix b/pkgs/tools/security/gitleaks/default.nix index 207ee746a107..47908e95c512 100644 --- a/pkgs/tools/security/gitleaks/default.nix +++ b/pkgs/tools/security/gitleaks/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildGoModule, fetchFromGitHub, gitleaks, @@ -31,7 +32,7 @@ buildGoModule rec { # With v8 the config tests are are blocking doCheck = false; - postInstall = '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd ${pname} \ --bash <($out/bin/${pname} completion bash) \ --fish <($out/bin/${pname} completion fish) \