From a730b5bf054867faa3e5de5fcff602c3518946e5 Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Wed, 14 Aug 2024 15:13:18 -0700 Subject: [PATCH 1/2] vfkit: init at 0.5.1 (cherry picked from commit 5beec28db8d7f54798de14ee61d6e3df85d28986) --- pkgs/by-name/vf/vfkit/package.nix | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pkgs/by-name/vf/vfkit/package.nix diff --git a/pkgs/by-name/vf/vfkit/package.nix b/pkgs/by-name/vf/vfkit/package.nix new file mode 100644 index 0000000000000..f51995d02c59c --- /dev/null +++ b/pkgs/by-name/vf/vfkit/package.nix @@ -0,0 +1,42 @@ +{ + lib, + fetchurl, + stdenvNoCC, + testers, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "vfkit"; + version = "0.5.1"; + + src = fetchurl { + url = "https://github.com/crc-org/vfkit/releases/download/v${finalAttrs.version}/vfkit"; + hash = "sha256-at+KsvsKO359d4VUvcSuio2ej5hM6//U4Mj/jqXwhEc="; + }; + + dontUnpack = true; + + installPhase = '' + runHook preInstall + + install -Dm755 $src $out/bin/vfkit + + runHook postInstall + ''; + + passthru.tests = { + version = testers.testVersion { package = finalAttrs.finalPackage; }; + }; + + meta = { + description = "Simple command line tool to start VMs through the macOS Virtualization framework"; + homepage = "https://github.com/crc-org/vfkit"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ sarcasticadmin ]; + platforms = lib.platforms.darwin; + # Source build will be possible after darwin SDK 12.0 bump + # https://github.com/NixOS/nixpkgs/pull/229210 + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + mainProgram = "vfkit"; + }; +}) From 6a31cde1c209372461764b5bdc4704ca5a9550de Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Wed, 14 Aug 2024 15:51:54 -0700 Subject: [PATCH 2/2] podman: add vfkit to PATH for darwin (cherry picked from commit eeed74efe3330459c77313f220b10e4bfc55f45d) --- pkgs/applications/virtualization/podman/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/virtualization/podman/default.nix b/pkgs/applications/virtualization/podman/default.nix index 1d5cb70e58861..d7bd2fccf5966 100644 --- a/pkgs/applications/virtualization/podman/default.nix +++ b/pkgs/applications/virtualization/podman/default.nix @@ -33,6 +33,7 @@ , aardvark-dns , netavark , passt +, vfkit , testers , podman }: @@ -44,6 +45,8 @@ let util-linux iptables iproute2 + ] ++ lib.optionals stdenv.isDarwin [ + vfkit ] ++ extraPackages); helpersBin = symlinkJoin {