From 424c93460b0344f1e7598828ec7a917790561ac6 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 13 Nov 2024 13:24:37 -0500 Subject: [PATCH 1/3] lima: 0.22.0 -> 1.0.1 --- pkgs/applications/virtualization/lima/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/virtualization/lima/default.nix b/pkgs/applications/virtualization/lima/default.nix index 318d54c77c41..e3c915752804 100644 --- a/pkgs/applications/virtualization/lima/default.nix +++ b/pkgs/applications/virtualization/lima/default.nix @@ -7,29 +7,28 @@ , xcbuild , sigtool , makeWrapper +, nix-update-script }: buildGoModule rec { pname = "lima"; - version = "0.22.0"; + version = "1.0.1"; src = fetchFromGitHub { owner = "lima-vm"; repo = pname; rev = "v${version}"; - sha256 = "sha256-ZX2FSZz9q56zWPSHPvXUOf2lzBupjgdTXgWpH1SBJY8="; + sha256 = "sha256-XYB8Nxbs76xmiiZ7IYfgn+UgUr6CLOalQrl6Ibo+DRc="; }; - vendorHash = "sha256-P0Qnfu/cqLveAwz9jf/wTXxkoh0jvazlE5C/PcUrWsA="; + vendorHash = "sha256-nNSBwvhKSWs6to37+RLziYQqVOYfvjYib3fRRALACho="; nativeBuildInputs = [ makeWrapper installShellFiles ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcrun sigtool ]; - # clean fails with read only vendor dir postPatch = '' substituteInPlace Makefile \ - --replace 'binaries: clean' 'binaries:' \ - --replace 'codesign --entitlements vz.entitlements -s -' 'codesign --force --entitlements vz.entitlements -s -' + --replace-fail 'codesign -f -v --entitlements vz.entitlements -s -' 'codesign -f --entitlements vz.entitlements -s -' ''; # It attaches entitlements with codesign and strip removes those, @@ -57,9 +56,11 @@ buildGoModule rec { doInstallCheck = true; installCheckPhase = '' - USER=nix $out/bin/limactl validate examples/default.yaml + USER=nix $out/bin/limactl validate templates/default.yaml ''; + passthru.updateScript = nix-update-script { }; + meta = with lib; { homepage = "https://github.com/lima-vm/lima"; description = "Linux virtual machines (on macOS, in most cases)"; From 22631622c609a7ac344b5ad52d13b2099faf7c22 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 13 Nov 2024 13:46:37 -0500 Subject: [PATCH 2/3] lima: fix vz driver support Otherwise, a newer lima fails to start a ubuntu VM with the following error: ``` vm driver 'vz' needs macOS 13 or later (Hint: try recompiling Lima if you are seeing this error on macOS 13) ``` While _13 would technically work, the virt library they use has availability checks up to 15: https://github.com/search?q=repo%3ACode-Hex%2Fvz+available+15&type=code --- pkgs/applications/virtualization/lima/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/virtualization/lima/default.nix b/pkgs/applications/virtualization/lima/default.nix index e3c915752804..29057cdf7d16 100644 --- a/pkgs/applications/virtualization/lima/default.nix +++ b/pkgs/applications/virtualization/lima/default.nix @@ -8,6 +8,7 @@ , sigtool , makeWrapper , nix-update-script +, apple-sdk_15 }: buildGoModule rec { @@ -26,6 +27,8 @@ buildGoModule rec { nativeBuildInputs = [ makeWrapper installShellFiles ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcrun sigtool ]; + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_15 ]; + postPatch = '' substituteInPlace Makefile \ --replace-fail 'codesign -f -v --entitlements vz.entitlements -s -' 'codesign -f --entitlements vz.entitlements -s -' From 9254e653c16431d642f79ee87e286aa1f117372c Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 13 Nov 2024 15:29:02 -0500 Subject: [PATCH 3/3] lima: drop explicit xcbuild dependency --- pkgs/applications/virtualization/lima/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/lima/default.nix b/pkgs/applications/virtualization/lima/default.nix index 29057cdf7d16..7cdde587183f 100644 --- a/pkgs/applications/virtualization/lima/default.nix +++ b/pkgs/applications/virtualization/lima/default.nix @@ -4,7 +4,6 @@ , fetchFromGitHub , installShellFiles , qemu -, xcbuild , sigtool , makeWrapper , nix-update-script @@ -25,7 +24,7 @@ buildGoModule rec { vendorHash = "sha256-nNSBwvhKSWs6to37+RLziYQqVOYfvjYib3fRRALACho="; nativeBuildInputs = [ makeWrapper installShellFiles ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcrun sigtool ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_15 ];