Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

81 lines
1.9 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
asciidoctor,
buildah,
buildah-unwrapped,
cargo,
libiconv,
libkrun,
makeWrapper,
rustc,
sigtool,
}:
stdenv.mkDerivation rec {
pname = "krunvm";
version = "0.2.4";
src = fetchFromGitHub {
owner = "containers";
repo = "krunvm";
rev = "v${version}";
hash = "sha256-YbK4DKw0nh9IO1F7QsJcbOMlHekEdeUBbDHwuQ2x1Ww=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
hash = "sha256-TMV9xCcqBQgPsUSzsTJAi4qsplTOSm3ilaUmtmdaGnE=";
};
nativeBuildInputs = [
rustPlatform.cargoSetupHook
cargo
rustc
asciidoctor
makeWrapper
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ];
buildInputs = [
libkrun
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
postPatch = ''
# do not pollute etc
substituteInPlace src/utils.rs \
--replace "etc/containers" "share/krunvm/containers"
'';
postInstall = ''
mkdir -p $out/share/krunvm/containers
install -D -m755 ${buildah-unwrapped.src}/docs/samples/registries.conf $out/share/krunvm/containers/registries.conf
install -D -m755 ${buildah-unwrapped.src}/tests/policy.json $out/share/krunvm/containers/policy.json
'';
# It attaches entitlements with codesign and strip removes those,
# voiding the entitlements and making it non-operational.
dontStrip = stdenv.hostPlatform.isDarwin;
postFixup = ''
wrapProgram $out/bin/krunvm \
--prefix PATH : ${lib.makeBinPath [ buildah ]} \
'';
meta = with lib; {
description = "CLI-based utility for creating microVMs from OCI images";
homepage = "https://github.com/containers/krunvm";
license = licenses.asl20;
maintainers = with maintainers; [ nickcao ];
platforms = libkrun.meta.platforms;
mainProgram = "krunvm";
};
}