Skip to content

Commit b4f035e

Browse files
committed
permit more options
1 parent 0eb051a commit b4f035e

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

example.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@
66
# Boot unikernel after building it
77
doCheck ? true,
88

9+
# Which architecture to build against
10+
arch ? "x86_64",
11+
912
# Enable multicore suport.
1013
smp ? false,
1114

1215
# Enable ccache support. See overlay.nix for details.
1316
withCcache ? false,
1417

18+
# Enable stricter requirements
19+
forProduction ? false,
20+
1521
# The includeos library to build and link against
1622
includeos ? import ./default.nix { inherit withCcache; inherit smp; },
1723
}:
1824

1925
includeos.stdenv.mkDerivation rec {
2026
pname = "includeos_example";
27+
version = "dev";
2128
src = includeos.pkgs.lib.cleanSource "${unikernel}";
2229
dontStrip = true;
2330
inherit doCheck;
@@ -33,10 +40,10 @@ includeos.stdenv.mkDerivation rec {
3340
];
3441

3542
cmakeFlags = [
36-
"-DARCH=x86_64"
43+
"-DARCH=${arch}"
3744
"-DINCLUDEOS_PACKAGE=${includeos}"
3845
"-DCMAKE_MODULE_PATH=${includeos}/cmake"
39-
"-DFOR_PRODUCTION=OFF"
46+
"-DFOR_PRODUCTION=${if forProduction then "ON" else "OFF"}"
4047
];
4148

4249
nativeCheckInputs = [
@@ -49,6 +56,4 @@ includeos.stdenv.mkDerivation rec {
4956
boot *.elf.bin
5057
runHook postCheck
5158
'';
52-
53-
version = "dev";
5459
}

0 commit comments

Comments
 (0)