Init
This commit is contained in:
30
nix/lib/nimBuildGenerator.nix
Normal file
30
nix/lib/nimBuildGenerator.nix
Normal 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}
|
||||
'';
|
||||
}
|
||||
24
nix/packages/nimExtraPackages.nix
Normal file
24
nix/packages/nimExtraPackages.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ pkgs, nimpkgs, ... }:
|
||||
|
||||
with pkgs;
|
||||
{
|
||||
fusion =
|
||||
(fetchFromGitHub
|
||||
({
|
||||
owner = "nim-lang";
|
||||
repo = "fusion";
|
||||
rev = "v1.1";
|
||||
sha256 = "9tn0NTXHhlpoefmlsSkoNZlCjGE8JB3eXtYcm/9Mr0I=";
|
||||
}));
|
||||
nimfp = with nimpkgs; [
|
||||
(pkgs.fetchFromGitHub
|
||||
({
|
||||
owner = "floscr";
|
||||
repo = "nimfp";
|
||||
rev = "master";
|
||||
sha256 = "sha256-gEs4qovho5qTXCquEG+fZOsL3rGB+Ql/r0IeLhnHjFk=";
|
||||
}))
|
||||
classy
|
||||
nimboost
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user