blob: 6c8c8a94a2181c81e131a6cc9325d2f8ac6d2dcc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
{
arches,
libkernel,
nixpkgs,
pkgs,
python,
system,
}:
let
mkKernel =
path:
let
args = import path;
arch = arches.${args.vernos-arch};
libkernel-arch = libkernel.${args.vernos-arch};
pkgs-arch = import nixpkgs {
inherit system;
crossSystem.config = arch.crossSystem;
};
in
pkgs-arch.stdenvNoCC.mkDerivation (
{
pname = "vernos-kernel-${args.vernos-board}";
version = libkernel-arch.version;
nativeBuildInputs = [
pkgs.ninja
pkgs-arch.stdenv.cc.bintools.bintools
python
];
dontUnpack = true;
configurePhase = ''
runHook preConfigure
python3 ${./configure.py} ${args.vernos-arch} ${args.vernos-board} \
${libkernel-arch} $src
runHook postConfigure
'';
installPhase = ''
runHook preInstall
install -Dt $out kernel.elf
runHook postInstall
'';
AS = "${arch.crossSystem}-as";
LD = "${arch.crossSystem}-ld";
}
// args
);
in
nixpkgs.lib.recurseIntoAttrs { qemu-virt = mkKernel ./qemu-virt; }
|