This commit is contained in:
Florian Schroedl
2022-01-20 17:00:00 +01:00
commit 300b165da9
12 changed files with 287 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
let
inherit (builtins) foldl';
in
rec {
makeNimBuildScript =
{ srcFile
, dstName
, packages ? [ ]
, extraLines ? [ ]
}:
let
packageLines = map (a: "-p:${a}/src") packages;
lines = [
"nim compile"
"-d:release"
"--hint[Processing]:off"
"--excessiveStackTrace:on"
] ++ packageLines
++ extraLines
++ [
"--out:$TMPDIR/${dstName}"
srcFile
];
buildCommand = foldl' (a: b: a + " " + b) "" lines;
in
''
HOME=$TMPDIR
${buildCommand}
'';
}