{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, dtc, openssl, }: rustPlatform.buildRustPackage rec { pname = "cloud-hypervisor"; version = "48.0"; src = fetchFromGitHub { owner = "cloud-hypervisor"; repo = "cloud-hypervisor"; rev = "v${version}"; hash = "sha256-cfS3sO1GQIxF9UlzKP9iE/UuJwGVIkNBN7GDF/ltn4Q="; }; cargoHash = "sha256-QvW1loljt9KzY0h2pG7n9NCkJJOYr/VxftsyqATm9DA="; separateDebugInfo = true; nativeBuildInputs = [ pkg-config ]; buildInputs = lib.optional stdenv.hostPlatform.isAarch64 dtc; checkInputs = [ openssl ]; OPENSSL_NO_VENDOR = true; cargoTestFlags = [ "--workspace" "--bins" "--lib" # Integration tests require root. "--exclude" "hypervisor" # /dev/kvm "--exclude" "net_util" # /dev/net/tun "--exclude" "vmm" # /dev/kvm ]; meta = { 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 lib.licenses; [ asl20 bsd3 ]; mainProgram = "cloud-hypervisor"; maintainers = with lib.maintainers; [ offline qyliss ]; platforms = [ "aarch64-linux" "riscv64-linux" "x86_64-linux" ]; }; }