lima-bin: Fix completion generation

It was running unpatched binary which was failing and thus generating
empty output. After https://github.com/NixOS/nixpkgs/pull/289517
installShellCompletion errors out because of this, which lead to broken
build.

Move installShellCompletion call to after autoPatchelfHook in
fixupPhase.
This commit is contained in:
Yuriy Taraday 2024-08-02 16:09:11 +02:00
parent a01c6c7e74
commit a58bfa1150

View File

@ -57,10 +57,17 @@ stdenvNoCC.mkDerivation {
chmod +x $out/bin/limactl
wrapProgram $out/bin/limactl \
--prefix PATH : ${lib.makeBinPath [ qemu ]}
installShellCompletion --cmd limactl \
--bash <($out/bin/limactl completion bash) \
--fish <($out/bin/limactl completion fish) \
--zsh <($out/bin/limactl completion zsh)
# the shell completion only works with a patched $out/bin/limactl and so
# needs to run after the autoPatchelfHook is executed in postFixup.
doShellCompletion() {
installShellCompletion --cmd limactl \
--bash <($out/bin/limactl completion bash) \
--fish <($out/bin/limactl completion fish) \
--zsh <($out/bin/limactl completion zsh)
}
postFixupHooks+=(doShellCompletion)
runHook postInstall
'';