From ac8cc9101171dfb12823352e7408d2e82ef77c3e Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 24 Jun 2025 03:28:33 +0900 Subject: [PATCH] lima: prefer versionCheckHook --- pkgs/by-name/li/lima/package.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/li/lima/package.nix b/pkgs/by-name/li/lima/package.nix index d5a251a3bd99..1bb3b3c6fd06 100644 --- a/pkgs/by-name/li/lima/package.nix +++ b/pkgs/by-name/li/lima/package.nix @@ -12,6 +12,7 @@ withAdditionalGuestAgents ? false, lima-additional-guestagents, writableTmpDirAsHomeHook, + versionCheckHook, testers, writeText, runCommand, @@ -92,14 +93,16 @@ buildGoModule (finalAttrs: { nativeInstallCheckInputs = [ # Workaround for: "panic: $HOME is not defined" at https://github.com/lima-vm/lima/blob/cb99e9f8d01ebb82d000c7912fcadcd87ec13ad5/pkg/limayaml/defaults.go#L53 writableTmpDirAsHomeHook + versionCheckHook ]; 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 = '' runHook preInstallCheck - [[ "$("$out/bin/limactl" --version | cut -d ' ' -f 3)" == "${finalAttrs.version}" ]] USER=nix $out/bin/limactl validate templates/default.yaml runHook postInstallCheck