tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
rust-hypervisor-firmware: init at 0.4.2
Astro
2 years ago
5cc9cef2
0fc009e2
+79
3 changed files
expand all
collapse all
unified
split
pkgs
applications
virtualization
rust-hypervisor-firmware
default.nix
x86_64-unknown-none.json
top-level
all-packages.nix
+57
pkgs/applications/virtualization/rust-hypervisor-firmware/default.nix
···
1
1
+
{ lib
2
2
+
, fetchFromGitHub
3
3
+
, makeRustPlatform
4
4
+
, hostPlatform
5
5
+
, targetPlatform
6
6
+
, lld
7
7
+
}:
8
8
+
9
9
+
let
10
10
+
arch = targetPlatform.qemuArch;
11
11
+
12
12
+
target = ./. + "/${arch}-unknown-none.json";
13
13
+
14
14
+
cross = import ../../../.. {
15
15
+
system = hostPlatform.system;
16
16
+
crossSystem = lib.systems.examples."${arch}-embedded" // {
17
17
+
rustc.config = "${arch}-unknown-none";
18
18
+
rustc.platform = lib.importJSON target;
19
19
+
};
20
20
+
};
21
21
+
22
22
+
inherit (cross) rustPlatform;
23
23
+
24
24
+
in
25
25
+
26
26
+
rustPlatform.buildRustPackage rec {
27
27
+
pname = "rust-hypervisor-firmware";
28
28
+
version = "0.4.2";
29
29
+
30
30
+
src = fetchFromGitHub {
31
31
+
owner = "cloud-hypervisor";
32
32
+
repo = pname;
33
33
+
rev = version;
34
34
+
sha256 = "sha256-hKk5pcop8rb5Q+IVchcl+XhMc3DCBBPn5P+AkAb9XxI=";
35
35
+
};
36
36
+
37
37
+
cargoSha256 = "sha256-edi6/Md6KebKM3wHArZe1htUCg0/BqMVZKA4xEH25GI=";
38
38
+
39
39
+
RUSTC_BOOTSTRAP = 1;
40
40
+
41
41
+
nativeBuildInputs = [
42
42
+
lld
43
43
+
];
44
44
+
45
45
+
RUSTFLAGS = "-C linker=lld -C linker-flavor=ld.lld";
46
46
+
47
47
+
# Tests don't work for `no_std`. See https://os.phil-opp.com/testing/
48
48
+
doCheck = false;
49
49
+
50
50
+
meta = with lib; {
51
51
+
homepage = "https://github.com/cloud-hypervisor/rust-hypervisor-firmware";
52
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
53
+
license = with licenses; [ asl20 ];
54
54
+
maintainers = with maintainers; [ astro ];
55
55
+
platforms = [ "x86_64-none" ];
56
56
+
};
57
57
+
}
+20
pkgs/applications/virtualization/rust-hypervisor-firmware/x86_64-unknown-none.json
···
1
1
+
{
2
2
+
"llvm-target": "x86_64-unknown-none",
3
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
4
+
"arch": "x86_64",
5
5
+
"target-endian": "little",
6
6
+
"target-pointer-width": "64",
7
7
+
"target-c-int-width": "32",
8
8
+
"os": "none",
9
9
+
"executables": true,
10
10
+
"linker": "rust-lld",
11
11
+
"linker-flavor": "ld.lld",
12
12
+
"panic-strategy": "abort",
13
13
+
"disable-redzone": true,
14
14
+
"features": "-mmx,-sse,+soft-float",
15
15
+
"code-model": "small",
16
16
+
"relocation-model": "pic",
17
17
+
"pre-link-args": {
18
18
+
"ld.lld": ["--script=x86_64-unknown-none.ld"]
19
19
+
}
20
20
+
}
+2
pkgs/top-level/all-packages.nix
···
25399
25399
25400
25400
qboot = pkgsi686Linux.callPackage ../applications/virtualization/qboot { };
25401
25401
25402
25402
+
rust-hypervisor-firmware = callPackage ../applications/virtualization/rust-hypervisor-firmware { };
25403
25403
+
25402
25404
OVMF = callPackage ../applications/virtualization/OVMF { };
25403
25405
OVMFFull = callPackage ../applications/virtualization/OVMF {
25404
25406
secureBoot = true;