2024-08-14 22:13:18 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-10-18 07:26:37 +00:00
|
|
|
apple-sdk_14,
|
|
|
|
buildGoModule,
|
|
|
|
darwin,
|
|
|
|
darwinMinVersionHook,
|
|
|
|
fetchFromGitHub,
|
2024-08-14 22:13:18 +00:00
|
|
|
testers,
|
2024-10-18 07:26:37 +00:00
|
|
|
vfkit,
|
2024-08-14 22:13:18 +00:00
|
|
|
}:
|
|
|
|
|
2024-10-18 07:26:37 +00:00
|
|
|
buildGoModule rec {
|
2024-08-14 22:13:18 +00:00
|
|
|
pname = "vfkit";
|
|
|
|
version = "0.5.1";
|
|
|
|
|
2024-10-18 07:26:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "crc-org";
|
|
|
|
repo = "vfkit";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-9iPr9VhN60B6kBikdEIFAs5mMH+VcmnjGhLuIa3A2JU=";
|
2024-08-14 22:13:18 +00:00
|
|
|
};
|
|
|
|
|
2024-10-18 07:26:37 +00:00
|
|
|
vendorHash = "sha256-6O1T9aOCymYXGAIR/DQBWfjc2sCyU/nZu9b1bIuXEps=";
|
2024-08-14 22:13:18 +00:00
|
|
|
|
2024-10-18 07:26:37 +00:00
|
|
|
subPackages = [ "cmd/vfkit" ];
|
2024-08-14 22:13:18 +00:00
|
|
|
|
2024-10-18 07:26:37 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/crc-org/vfkit/pkg/cmdline.gitVersion=${src.rev}"
|
|
|
|
];
|
2024-08-14 22:13:18 +00:00
|
|
|
|
2024-10-18 07:26:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
darwin.sigtool
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
apple-sdk_14
|
|
|
|
(darwinMinVersionHook "11")
|
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
codesign --entitlements vf.entitlements -f -s - $out/bin/vfkit
|
2024-08-14 22:13:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
2024-10-18 07:26:37 +00:00
|
|
|
version = testers.testVersion { package = vfkit; };
|
2024-08-14 22:13:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
2024-10-18 07:26:37 +00:00
|
|
|
sourceProvenance = [ lib.sourceTypes.fromSource ];
|
2024-08-14 22:13:18 +00:00
|
|
|
mainProgram = "vfkit";
|
|
|
|
};
|
2024-10-18 07:26:37 +00:00
|
|
|
}
|