-
Notifications
You must be signed in to change notification settings - Fork 364
/
chainloader.nix
51 lines (44 loc) · 1.06 KB
/
chainloader.nix
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
{
withCcache ? false, # Enable ccache. Requires /nix/var/cache/ccache to exist with correct permissions.
nixpkgs ? ./pinned.nix,
overlays ? [
(import ./overlay.nix {
inherit withCcache;
smp = false; # No SMP for chainloader
})
],
pkgs ? import nixpkgs {
config = { };
inherit overlays;
crossSystem = {
config = "i686-unknown-linux-musl";
};
},
}:
let
includeos = pkgs.pkgsIncludeOS.includeos;
stdenv = pkgs.pkgsIncludeOS.stdenv;
in
assert (stdenv.targetPlatform.system != "i686-linux") ->
throw "Chainloader must be built as 32-bit target";
assert (stdenv.targetPlatform.isLinux == false) ->
throw "Target platform must be Linux";
assert (stdenv.targetPlatform.isMusl == false) ->
throw "Target stdenv should be based on Musl";
stdenv.mkDerivation rec {
pname = "chainloader";
version = "dev";
sourceRoot = "./src/chainload/";
buildInputs = [
includeos
];
srcs = [
./src
./api
./cmake
];
nativeBuildInputs = [
pkgs.buildPackages.cmake
pkgs.buildPackages.nasm
];
}