Generate shell completions using process substitution

Practically this makes no difference but it's slightly more elegant.
This commit is contained in:
adisbladis 2022-08-24 11:50:44 +08:00
parent 704aa9566a
commit 055777bf88

View file

@ -28,10 +28,10 @@ buildGoApplication {
}; };
postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) ''
$out/bin/gomod2nix completion bash > gomod2nix.bash installShellCompletion --cmd gomod2nix \
$out/bin/gomod2nix completion fish > gomod2nix.fish --bash <($out/bin/gomod2nix completion bash) \
$out/bin/gomod2nix completion zsh > _gomod2nix --fish <($out/bin/gomod2nix completion fish) \
installShellCompletion gomod2nix.{bash,fish} _gomod2nix --zsh <($out/bin/gomod2nix completion zsh)
'' + '' '' + ''
wrapProgram $out/bin/gomod2nix --prefix PATH : ${lib.makeBinPath [ go ]} wrapProgram $out/bin/gomod2nix --prefix PATH : ${lib.makeBinPath [ go ]}
''; '';