pulumi-bin: install shell completion

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2022-07-30 15:41:46 -05:00
parent eabe2192ea
commit f5910772e5

View file

@ -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/";