{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, dtc, openssl }: rustPlatform.buildRustPackage rec { pname = "cloud-hypervisor"; version = "23.0"; src = fetchFromGitHub { owner = "cloud-hypervisor"; repo = pname; rev = "v${version}"; sha256 = "0gq23zhpl1rw8i3yv0f058lycsr078yfy8vkb5w382pifgrww1zh"; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ openssl ] ++ lib.optional stdenv.isAarch64 dtc; cargoSha256 = "0r3r6r5scbw23ipz24glcyvaxx9sffy8kp27fpqvwdha915c1zkp"; OPENSSL_NO_VENDOR = true; # Integration tests require root. cargoTestFlags = [ "--bins" ]; meta = with lib; { homepage = "https://github.com/cloud-hypervisor/cloud-hypervisor"; description = "Open source Virtual Machine Monitor (VMM) that runs on top of KVM"; changelog = "https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v${version}"; license = with licenses; [ asl20 bsd3 ]; maintainers = with maintainers; [ offline qyliss ]; platforms = [ "aarch64-linux" "x86_64-linux" ]; }; }