lima: prefer versionCheckHook

This commit is contained in:
Kenichi Kamiya 2025-06-24 03:28:33 +09:00
parent f6248cd5f8
commit ac8cc91011
No known key found for this signature in database
GPG Key ID: 9BE4016A38165CCB

View File

@ -12,6 +12,7 @@
withAdditionalGuestAgents ? false, withAdditionalGuestAgents ? false,
lima-additional-guestagents, lima-additional-guestagents,
writableTmpDirAsHomeHook, writableTmpDirAsHomeHook,
versionCheckHook,
testers, testers,
writeText, writeText,
runCommand, runCommand,
@ -92,14 +93,16 @@ buildGoModule (finalAttrs: {
nativeInstallCheckInputs = [ nativeInstallCheckInputs = [
# Workaround for: "panic: $HOME is not defined" at https://github.com/lima-vm/lima/blob/cb99e9f8d01ebb82d000c7912fcadcd87ec13ad5/pkg/limayaml/defaults.go#L53 # Workaround for: "panic: $HOME is not defined" at https://github.com/lima-vm/lima/blob/cb99e9f8d01ebb82d000c7912fcadcd87ec13ad5/pkg/limayaml/defaults.go#L53
writableTmpDirAsHomeHook writableTmpDirAsHomeHook
versionCheckHook
]; ];
doInstallCheck = true; doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/limactl";
versionCheckProgramArg = "--version";
versionCheckKeepEnvironment = [ "HOME" ];
# Don't use versionCheckHook for this package until Env solutions like #403971 or #411609 are available on the master branch.
installCheckPhase = '' installCheckPhase = ''
runHook preInstallCheck runHook preInstallCheck
[[ "$("$out/bin/limactl" --version | cut -d ' ' -f 3)" == "${finalAttrs.version}" ]]
USER=nix $out/bin/limactl validate templates/default.yaml USER=nix $out/bin/limactl validate templates/default.yaml
runHook postInstallCheck runHook postInstallCheck