16 stdenv.mkDerivation rec {
20 src = if stdenv.isLinux then fetchFromGitHub {
24 hash = "sha256-qVyEqiqaQ8wfZhL5u+Bsaa1yXlgHUitSj5bo7FJ5Y8c=";
26 url = "https://github.com/containers/libkrun/releases/download/v${version}/v${version}-with_macos_prebuilts.tar.gz";
27 hash = "sha256-RBqeGUhB6Sdt+JujyQBW/76mZwnT0LNs9AMYr8+OCVU=";
30 cargoDeps = rustPlatform.fetchCargoTarball {
32 hash = "sha256-jxSzhj1iU8qY+sZEVCYTaUqpaA4egjJi9qxrapASQF0=";
35 nativeBuildInputs = with rustPlatform; [
39 ] ++ lib.optional sevVariant pkg-config;
42 (libkrunfw.override { inherit sevVariant; })
43 ] ++ lib.optionals stdenv.isLinux [
46 ] ++ lib.optionals stdenv.isDarwin [
50 ] ++ lib.optional sevVariant openssl;
52 makeFlags = [ "PREFIX=${placeholder "out"}" ]
53 ++ lib.optional sevVariant "SEV=1";
55 postFixup = lib.optionalString stdenv.isDarwin ''
56 install_name_tool -id $out/lib/libkrun.dylib $out/lib/libkrun.${version}.dylib
60 description = "A dynamic library providing Virtualization-based process isolation capabilities";
61 homepage = "https://github.com/containers/libkrun";
62 license = licenses.asl20;
63 maintainers = with maintainers; [ nickcao ];