22 stdenv.mkDerivation (finalAttrs: {
26 src = fetchFromGitHub {
29 rev = "refs/tags/v${finalAttrs.version}";
30 hash = "sha256-fVL49g71eyfYyeXI4B1qRNM90fBKjHeq0I4poz1pdME=";
33 outputs = [ "out" "dev" ];
35 cargoDeps = rustPlatform.fetchCargoTarball {
36 inherit (finalAttrs) src;
37 hash = "sha256-MW4/iB2NsCj0s9Q/h/PoCIIaDfZ/iqw+FGrsJmVR0lw=";
42 rustPlatform.cargoSetupHook
45 ] ++ lib.optional (sevVariant || withGpu) pkg-config;
48 (libkrunfw.override { inherit sevVariant; })
51 ] ++ lib.optionals withGpu [ libepoxy libdrm virglrenderer ]
52 ++ lib.optional withSound pipewire
53 ++ lib.optional sevVariant openssl;
55 env.LIBCLANG_PATH = "${lib.getLib llvmPackages.clang-unwrapped}/lib/libclang.so";
58 "PREFIX=${placeholder "out"}"
59 ] ++ lib.optional withGpu "GPU=1"
60 ++ lib.optional withSound "SND=1"
61 ++ lib.optional withNet "NET=1"
62 ++ lib.optional sevVariant "SEV=1";
65 mkdir -p $dev/lib/pkgconfig
66 mv $out/lib64/pkgconfig $dev/lib/pkgconfig
67 mv $out/include $dev/include
71 description = "Dynamic library providing Virtualization-based process isolation capabilities";
72 homepage = "https://github.com/containers/libkrun";
73 license = licenses.asl20;
74 maintainers = with maintainers; [ nickcao RossComputerGuy ];
75 platforms = libkrunfw.meta.platforms;