sigil/tests/nim.nix

47 lines
1.2 KiB
Nix
Raw Normal View History

{
name = "nim";
machine = { pkgs, ... }: {
2022-10-20 21:33:18 +02:00
genode.init.children.test_nim = {
package = with pkgs;
nimPackages.buildNimPackage {
pname = "test_nim";
inherit (nim) version;
2022-10-20 21:33:18 +02:00
nimDefines.posix = {};
unpackPhase = ''
mkdir test
cd test
echo 'echo "Hello Nim world!"' > test_nim.nim
cat << EOF > eris_patch.nimble
backend = "cpp"
bin = @[ "test_nim"]
EOF
'';
};
configFile = builtins.toFile "nim.dhall" ''
2021-03-28 15:07:21 +02:00
let Sigil = env:DHALL_SIGIL
2021-03-28 15:07:21 +02:00
let Init = Sigil.Init
let Child = Init.Child
in λ(binary : Text)
Child.flat
Child.Attributes::{
, binary
, config = Init.Config::{ attributes = toMap { ld_verbose = "true" } }
, exitPropagate = True
2021-03-28 15:07:21 +02:00
, resources = Sigil.Init.Resources::{
, caps = 500
2021-03-28 15:07:21 +02:00
, ram = Sigil.units.MiB 10
}
}
'';
};
};
testScript = ''
start_all()
machine.wait_until_serial_output("Hello Nim world!")
'';
}