16 src = fetchFromGitHub {
20 sha256 = "sha256-ZX2FSZz9q56zWPSHPvXUOf2lzBupjgdTXgWpH1SBJY8=";
23 vendorHash = "sha256-P0Qnfu/cqLveAwz9jf/wTXxkoh0jvazlE5C/PcUrWsA=";
25 nativeBuildInputs = [ makeWrapper installShellFiles ]
26 ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcrun sigtool ];
28 # clean fails with read only vendor dir
30 substituteInPlace Makefile \
31 --replace 'binaries: clean' 'binaries:' \
32 --replace 'codesign --entitlements vz.entitlements -s -' 'codesign --force --entitlements vz.entitlements -s -'
35 # It attaches entitlements with codesign and strip removes those,
36 # voiding the entitlements and making it non-operational.
37 dontStrip = stdenv.hostPlatform.isDarwin;
41 make "VERSION=v${version}" binaries
49 wrapProgram $out/bin/limactl \
50 --prefix PATH : ${lib.makeBinPath [ qemu ]}
51 installShellCompletion --cmd limactl \
52 --bash <($out/bin/limactl completion bash) \
53 --fish <($out/bin/limactl completion fish) \
54 --zsh <($out/bin/limactl completion zsh)
58 doInstallCheck = true;
59 installCheckPhase = ''
60 USER=nix $out/bin/limactl validate examples/default.yaml
64 homepage = "https://github.com/lima-vm/lima";
65 description = "Linux virtual machines (on macOS, in most cases)";
66 changelog = "https://github.com/lima-vm/lima/releases/tag/v${version}";
67 license = licenses.asl20;
68 maintainers = with maintainers; [ anhduy ];