rust-hypervisor-firmware: init at 0.4.2

Astro 5cc9cef2 0fc009e2

+79
+57
pkgs/applications/virtualization/rust-hypervisor-firmware/default.nix
··· 1 + { lib 2 + , fetchFromGitHub 3 + , makeRustPlatform 4 + , hostPlatform 5 + , targetPlatform 6 + , lld 7 + }: 8 + 9 + let 10 + arch = targetPlatform.qemuArch; 11 + 12 + target = ./. + "/${arch}-unknown-none.json"; 13 + 14 + cross = import ../../../.. { 15 + system = hostPlatform.system; 16 + crossSystem = lib.systems.examples."${arch}-embedded" // { 17 + rustc.config = "${arch}-unknown-none"; 18 + rustc.platform = lib.importJSON target; 19 + }; 20 + }; 21 + 22 + inherit (cross) rustPlatform; 23 + 24 + in 25 + 26 + rustPlatform.buildRustPackage rec { 27 + pname = "rust-hypervisor-firmware"; 28 + version = "0.4.2"; 29 + 30 + src = fetchFromGitHub { 31 + owner = "cloud-hypervisor"; 32 + repo = pname; 33 + rev = version; 34 + sha256 = "sha256-hKk5pcop8rb5Q+IVchcl+XhMc3DCBBPn5P+AkAb9XxI="; 35 + }; 36 + 37 + cargoSha256 = "sha256-edi6/Md6KebKM3wHArZe1htUCg0/BqMVZKA4xEH25GI="; 38 + 39 + RUSTC_BOOTSTRAP = 1; 40 + 41 + nativeBuildInputs = [ 42 + lld 43 + ]; 44 + 45 + RUSTFLAGS = "-C linker=lld -C linker-flavor=ld.lld"; 46 + 47 + # Tests don't work for `no_std`. See https://os.phil-opp.com/testing/ 48 + doCheck = false; 49 + 50 + meta = with lib; { 51 + homepage = "https://github.com/cloud-hypervisor/rust-hypervisor-firmware"; 52 + description = "A simple firmware that is designed to be launched from anything that supports loading ELF binaries and running them with the PVH booting standard"; 53 + license = with licenses; [ asl20 ]; 54 + maintainers = with maintainers; [ astro ]; 55 + platforms = [ "x86_64-none" ]; 56 + }; 57 + }
+20
pkgs/applications/virtualization/rust-hypervisor-firmware/x86_64-unknown-none.json
··· 1 + { 2 + "llvm-target": "x86_64-unknown-none", 3 + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", 4 + "arch": "x86_64", 5 + "target-endian": "little", 6 + "target-pointer-width": "64", 7 + "target-c-int-width": "32", 8 + "os": "none", 9 + "executables": true, 10 + "linker": "rust-lld", 11 + "linker-flavor": "ld.lld", 12 + "panic-strategy": "abort", 13 + "disable-redzone": true, 14 + "features": "-mmx,-sse,+soft-float", 15 + "code-model": "small", 16 + "relocation-model": "pic", 17 + "pre-link-args": { 18 + "ld.lld": ["--script=x86_64-unknown-none.ld"] 19 + } 20 + }
+2
pkgs/top-level/all-packages.nix
··· 25399 25399 25400 25400 qboot = pkgsi686Linux.callPackage ../applications/virtualization/qboot { }; 25401 25401 25402 + rust-hypervisor-firmware = callPackage ../applications/virtualization/rust-hypervisor-firmware { }; 25403 + 25402 25404 OVMF = callPackage ../applications/virtualization/OVMF { }; 25403 25405 OVMFFull = callPackage ../applications/virtualization/OVMF { 25404 25406 secureBoot = true;