migrate nim pkg to nix
This commit is contained in:
parent
f94ba284df
commit
ab536f35ff
|
@ -1,18 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
PREFIX=$(realpath $(dirname $0))
|
||||
|
||||
mkdir -p build
|
||||
|
||||
cd build
|
||||
|
||||
# Prebuilt binary - source *can* be built, but it requires gcc
|
||||
curl -L "https://nim-lang.org/download/nim-1.4.4-linux_x64.tar.xz" -o nim.tar.xz
|
||||
tar xf nim.tar.xz --strip-components=1
|
||||
rm nim.tar.xz
|
||||
|
||||
./install.sh "$PREFIX"
|
||||
|
||||
cd ../
|
||||
|
||||
rm -rf build
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Compile nim file(s)
|
||||
nim --hints:off --out:out --nimcache:./ c "$@"
|
||||
chmod +x out
|
|
@ -1 +0,0 @@
|
|||
export PATH=$PWD/nim/bin:$PATH
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "nim",
|
||||
"version": "1.4.4",
|
||||
"aliases": ["nim"]
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
shift # Filename is only used to compile
|
||||
./out "$@"
|
|
@ -1 +0,0 @@
|
|||
echo("OK")
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue