add vlang
This commit is contained in:
parent
c39c671a12
commit
1df354c503
|
@ -14,6 +14,7 @@ args: {
|
|||
"erlang" = import ./erlang.nix args;
|
||||
"gawk-awk" = import ./gawk-awk.nix args;
|
||||
"openjdk11_headless-java" = import ./openjdk11_headless-java.nix args;
|
||||
"zig" = import ./zig.nix args;
|
||||
"ruby" = import ./ruby.nix args;
|
||||
"zig" = import ./zig.nix args;
|
||||
"vlang" = import ./vlang.nix args;
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue