Commit f5910772 authored by Austin Seipp's avatar Austin Seipp
Browse files

pulumi-bin: install shell completion



Signed-off-by: default avatarAustin Seipp <aseipp@pobox.com>
parent eabe2192
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
{ 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/";