add vlang

This commit is contained in:
Dan Vargas 2022-02-02 11:13:33 -07:00
parent c39c671a12
commit 1df354c503
2 changed files with 42 additions and 1 deletions

View File

@ -14,6 +14,7 @@ args: {
"erlang" = import ./erlang.nix args; "erlang" = import ./erlang.nix args;
"gawk-awk" = import ./gawk-awk.nix args; "gawk-awk" = import ./gawk-awk.nix args;
"openjdk11_headless-java" = import ./openjdk11_headless-java.nix args; "openjdk11_headless-java" = import ./openjdk11_headless-java.nix args;
"zig" = import ./zig.nix args;
"ruby" = import ./ruby.nix args; "ruby" = import ./ruby.nix args;
"zig" = import ./zig.nix args;
"vlang" = import ./vlang.nix args;
} }

40
runtimes/vlang.nix Normal file
View File

@ -0,0 +1,40 @@
{pkgs, piston, ...}:
let
pkg = pkgs.vlang;
in piston.mkRuntime {
language = "vlang";
version = pkg.version;
aliases = [
"v"
];
run = ''
# vlang env
export VMODULES="$PWD"
export TMPDIR="$PWD"
# modify file extension
mv "$1" "$1.v"
filename="$1.v"
shift
${pkg}/bin/v run "$filename" "$@"
'';
tests = [
(piston.mkTest {
files = {
"file0.code" = ''
fn main() {
println('OK')
}
'';
};
args = [];
stdin = "";
packages = [];
main = "file0.code";
})
];
}