migrate nim pkg to nix

This commit is contained in:
Dan Vargas 2022-02-06 21:45:52 -07:00
parent f94ba284df
commit ab536f35ff
8 changed files with 33 additions and 34 deletions

View file

@ -30,4 +30,5 @@ args: {
"perl" = import ./perl.nix args;
"octave" = import ./octave.nix args;
"ocaml" = import ./ocaml.nix args;
"nim" = import ./nim.nix args;
}

32
runtimes/nim.nix Normal file
View file

@ -0,0 +1,32 @@
{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";
})
];
}