8 arch = stdenv.hostPlatform.qemuArch;
10 target = ./. + "/${arch}-unknown-none.json";
14 assert lib.assertMsg (builtins.pathExists target) "Target spec not found";
17 cross = import ../../../.. {
18 system = stdenv.hostPlatform.system;
19 crossSystem = lib.systems.examples."${arch}-embedded" // {
20 rust.rustcTarget = "${arch}-unknown-none";
21 rust.platform = lib.importJSON target;
25 inherit (cross) rustPlatform;
29 rustPlatform.buildRustPackage rec {
30 pname = "rust-hypervisor-firmware";
33 src = fetchFromGitHub {
34 owner = "cloud-hypervisor";
37 sha256 = "sha256-hKk5pcop8rb5Q+IVchcl+XhMc3DCBBPn5P+AkAb9XxI=";
40 cargoHash = "sha256-edi6/Md6KebKM3wHArZe1htUCg0/BqMVZKA4xEH25GI=";
42 # lld: error: unknown argument '-Wl,--undefined=AUDITABLE_VERSION_INFO'
43 # https://github.com/cloud-hypervisor/rust-hypervisor-firmware/issues/249
52 RUSTFLAGS = "-C linker=lld -C linker-flavor=ld.lld";
54 # Tests don't work for `no_std`. See https://os.phil-opp.com/testing/
58 homepage = "https://github.com/cloud-hypervisor/rust-hypervisor-firmware";
59 description = "Simple firmware that is designed to be launched from anything that supports loading ELF binaries and running them with the PVH booting standard";
60 license = with licenses; [ asl20 ];
61 maintainers = with maintainers; [ astro ];
62 platforms = [ "x86_64-none" ];
63 mainProgram = "hypervisor-fw";