From f5910772e59efe2bb28e5fb60457978614ebc8e8 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Sat, 30 Jul 2022 15:41:46 -0500 Subject: [PATCH] pulumi-bin: install shell completion Signed-off-by: Austin Seipp --- pkgs/tools/admin/pulumi/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/admin/pulumi/default.nix b/pkgs/tools/admin/pulumi/default.nix index 02e1bb29c01b..71c61d7a0543 100644 --- a/pkgs/tools/admin/pulumi/default.nix +++ b/pkgs/tools/admin/pulumi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper }: +{ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper, installShellFiles }: with lib; @@ -15,13 +15,17 @@ in stdenv.mkDerivation { srcs = map (x: fetchurl x) data.pulumiPkgs.${stdenv.hostPlatform.system}; installPhase = '' - mkdir -p $out/bin - cp * $out/bin/ + install -D -t $out/bin/ * '' + optionalString stdenv.isLinux '' wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${stdenv.cc.cc.lib}/lib" + '' + '' + installShellCompletion --cmd pulumi \ + --bash <($out/bin/pulumi completion bash) \ + --fish <($out/bin/pulumi completion fish) \ + --zsh <($out/bin/pulumi completion zsh) ''; - nativeBuildInputs = optionals stdenv.isLinux [ autoPatchelfHook makeWrapper ]; + nativeBuildInputs = [ installShellFiles ] ++ optionals stdenv.isLinux [ autoPatchelfHook makeWrapper ]; meta = { homepage = "https://pulumi.io/";