16 stdenv.mkDerivation rec {
20 src = fetchFromGitHub {
24 hash = "sha256-IXofYsOmbrjq8Zq9+a6pvBYsvZFcKzN5IvCuHaxwazI=";
27 cargoDeps = rustPlatform.fetchCargoTarball {
29 hash = "sha256-Y0FNi/+HuN5SqexHTKjcW6lEaeis7xZDYc2/FOAANIA=";
33 rustPlatform.cargoSetupHook
38 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ];
40 buildInputs = [ libkrun ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
44 makeFlags = [ "PREFIX=${placeholder "out"}" ];
48 substituteInPlace src/utils.rs \
49 --replace "etc/containers" "share/krunvm/containers"
53 mkdir -p $out/share/krunvm/containers
54 install -D -m755 ${buildah-unwrapped.src}/docs/samples/registries.conf $out/share/krunvm/containers/registries.conf
55 install -D -m755 ${buildah-unwrapped.src}/tests/policy.json $out/share/krunvm/containers/policy.json
58 # It attaches entitlements with codesign and strip removes those,
59 # voiding the entitlements and making it non-operational.
60 dontStrip = stdenv.hostPlatform.isDarwin;
63 wrapProgram $out/bin/krunvm \
64 --prefix PATH : ${lib.makeBinPath [ buildah ]} \
68 description = "CLI-based utility for creating microVMs from OCI images";
69 homepage = "https://github.com/containers/krunvm";
70 license = licenses.asl20;
71 maintainers = with maintainers; [ nickcao ];
72 platforms = libkrun.meta.platforms;
73 mainProgram = "krunvm";