lima: fix cross
Only try to generate shell completions if the executables can be run
This commit is contained in:
parent
32fc989515
commit
711b9bd4c8
@ -57,7 +57,7 @@ stdenvNoCC.mkDerivation {
|
||||
chmod +x $out/bin/limactl
|
||||
wrapProgram $out/bin/limactl \
|
||||
--prefix PATH : ${lib.makeBinPath [ qemu ]}
|
||||
|
||||
'' + lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
|
||||
# the shell completion only works with a patched $out/bin/limactl and so
|
||||
# needs to run after the autoPatchelfHook is executed in postFixup.
|
||||
doShellCompletion() {
|
||||
@ -67,7 +67,7 @@ stdenvNoCC.mkDerivation {
|
||||
--zsh <($out/bin/limactl completion zsh)
|
||||
}
|
||||
postFixupHooks+=(doShellCompletion)
|
||||
|
||||
'' + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
|
@ -54,10 +54,12 @@ buildGoModule rec {
|
||||
cp -r _output/* $out
|
||||
wrapProgram $out/bin/limactl \
|
||||
--prefix PATH : ${lib.makeBinPath [ qemu ]}
|
||||
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd limactl \
|
||||
--bash <($out/bin/limactl completion bash) \
|
||||
--fish <($out/bin/limactl completion fish) \
|
||||
--zsh <($out/bin/limactl completion zsh)
|
||||
'' + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user