diff --git a/pkgs/applications/virtualization/lima/bin.nix b/pkgs/applications/virtualization/lima/bin.nix index ca45c58ff219..b0a90987d1d2 100644 --- a/pkgs/applications/virtualization/lima/bin.nix +++ b/pkgs/applications/virtualization/lima/bin.nix @@ -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 ''; diff --git a/pkgs/applications/virtualization/lima/default.nix b/pkgs/applications/virtualization/lima/default.nix index 0f9ffb1dbc54..9878b425329b 100644 --- a/pkgs/applications/virtualization/lima/default.nix +++ b/pkgs/applications/virtualization/lima/default.nix @@ -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 '';