diff --git a/pkgs/development/nim-packages/build-nim-package/default.nix b/pkgs/development/nim-packages/build-nim-package/default.nix index 46d898cc1d22..5ad181252df4 100644 --- a/pkgs/development/nim-packages/build-nim-package/default.nix +++ b/pkgs/development/nim-packages/build-nim-package/default.nix @@ -2,10 +2,10 @@ { strictDeps ? true, depsBuildBuild ? [ ], nativeBuildInputs ? [ ] , configurePhase ? null, buildPhase ? null, checkPhase ? null -, installPhase ? null, meta ? { }, ... }@attrs: +, installPhase ? null, enableParallelBuilding ? true, meta ? { }, ... }@attrs: stdenv.mkDerivation (attrs // { - inherit strictDeps; + inherit strictDeps enableParallelBuilding; depsBuildBuild = [ nim_builder ] ++ depsBuildBuild; nativeBuildInputs = [ nim ] ++ nativeBuildInputs; diff --git a/pkgs/development/nim-packages/nim_builder/nim_builder.nim b/pkgs/development/nim-packages/nim_builder/nim_builder.nim index 0cb68e63f137..8bb78555c269 100644 --- a/pkgs/development/nim-packages/nim_builder/nim_builder.nim +++ b/pkgs/development/nim-packages/nim_builder/nim_builder.nim @@ -119,8 +119,8 @@ proc buildPhase*() = binDir = getOutputDir("bin") / "bin" if bins != @[]: for bin in bins: - cmds.add("nim compile $# --outdir:$# $#" % - [getenv"nimFlags", binDir, normalizedPath(srcDir / bin)]) + cmds.add("nim compile $# --parallelBuild:$# --outdir:$# $#" % + [getenv("nimFlags"), getenv("NIX_BUILD_CORES","1"), binDir, normalizedPath(srcDir / bin)]) if getEnvBool"nimDoc": echo "generating documentation" let docDir = getOutputDir("doc") / "doc"