piston/runtimes/nim.nix

32 lines
587 B
Nix
Raw Normal View History

2022-02-07 05:45:52 +01:00
{pkgs, piston, ...}:
let
pkg = pkgs.nim;
in piston.mkRuntime {
language = "nim";
version = pkg.version;
aliases = [];
compile = ''
${pkg}/bin/nim --hints:off --out:out --nimcache:./ c "$@"
chmod +x out
'';
run = ''
shift
./out "$@"
'';
tests = [
(piston.mkTest {
files = {
"test.nim" = ''
echo("OK")
'';
};
args = [];
stdin = "";
packages = [];
main = "test.nim";
})
];
}