zarf: fix shell completions on Darwin (#446215)

authored by Aleksana and committed by GitHub 9b40f06b ba6b7687

+15 -10
+15 -10
pkgs/by-name/za/zarf/package.nix
··· 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 installShellFiles, 6 stdenv, 7 }: 8 ··· 20 vendorHash = "sha256-As7xDEo+bMslv9Xd6CbHTqvf2XaXmO6Gp3f9+xD3kNU="; 21 proxyVendor = true; 22 23 - nativeBuildInputs = [ installShellFiles ]; 24 25 preBuild = '' 26 mkdir -p build/ui ··· 43 "k8s.io/component-base/version.buildDate=1970-01-01T00:00:00Z" 44 ]; 45 46 - # Breaks with sandbox on Darwin because it wants to read /etc/protocols 47 postInstall = 48 lib.optionalString 49 - ((stdenv.buildPlatform.canExecute stdenv.hostPlatform) && !stdenv.buildPlatform.isDarwin) 50 - '' 51 - export K9S_LOGS_DIR=$(mktemp -d) 52 - installShellCompletion --cmd zarf \ 53 - --bash <($out/bin/zarf completion bash) \ 54 - --fish <($out/bin/zarf completion fish) \ 55 - --zsh <($out/bin/zarf completion zsh) 56 - ''; 57 58 meta = with lib; { 59 description = "DevSecOps for Air Gap & Limited-Connection Systems. https://zarf.dev";
··· 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 + iana-etc, 6 installShellFiles, 7 + libredirect, 8 stdenv, 9 }: 10 ··· 22 vendorHash = "sha256-As7xDEo+bMslv9Xd6CbHTqvf2XaXmO6Gp3f9+xD3kNU="; 23 proxyVendor = true; 24 25 + nativeBuildInputs = [ 26 + installShellFiles 27 + ] 28 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libredirect.hook ]; 29 30 preBuild = '' 31 mkdir -p build/ui ··· 48 "k8s.io/component-base/version.buildDate=1970-01-01T00:00:00Z" 49 ]; 50 51 postInstall = 52 lib.optionalString 53 + (stdenv.buildPlatform.canExecute stdenv.hostPlatform && stdenv.hostPlatform.isDarwin) 54 + "export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/services=${iana-etc}/etc/services" 55 + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 56 + export K9S_LOGS_DIR=$(mktemp -d) 57 + installShellCompletion --cmd zarf \ 58 + --bash <($out/bin/zarf completion bash) \ 59 + --fish <($out/bin/zarf completion fish) \ 60 + --zsh <($out/bin/zarf completion zsh) 61 + ''; 62 63 meta = with lib; { 64 description = "DevSecOps for Air Gap & Limited-Connection Systems. https://zarf.dev";