1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00

Merge pull request #13402 from DavHau/build-cores

build-cores: detect cores automatically if set to 0
This commit is contained in:
Sergei Zimmerman 2025-07-09 23:06:55 +03:00 committed by GitHub
commit b19e9acc03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 58 additions and 10 deletions

View file

@ -1083,7 +1083,7 @@ void DerivationBuilderImpl::initEnv()
env["NIX_STORE"] = store.storeDir;
/* The maximum number of cores to utilize for parallel building. */
env["NIX_BUILD_CORES"] = fmt("%d", settings.buildCores);
env["NIX_BUILD_CORES"] = fmt("%d", settings.buildCores ? settings.buildCores : settings.getDefaultCores());
/* In non-structured mode, set all bindings either directory in the
environment or via a file, as specified by