Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #4750 from abbradar/nix-maxcores

Add buildCores option to nix

lethalman f079cd17 e1d2e1dd

+14
+14
nixos/modules/services/misc/nix-daemon.nix
··· 36 36 # /etc/nixos/configuration.nix. Do not edit it! 37 37 build-users-group = nixbld 38 38 build-max-jobs = ${toString (cfg.maxJobs)} 39 + build-cores = ${toString (cfg.buildCores)} 39 40 build-use-chroot = ${if cfg.useChroot then "true" else "false"} 40 41 build-chroot-dirs = ${toString cfg.chrootDirs} /bin/sh=${sh} $(echo $extraPaths) 41 42 binary-caches = ${toString cfg.binaryCaches} ··· 72 73 set it to the number of CPUs in your system (e.g., 2 on an Athlon 73 74 64 X2). 74 75 "; 76 + }; 77 + 78 + buildCores = mkOption { 79 + type = types.int; 80 + default = 1; 81 + example = 64; 82 + description = '' 83 + This option defines the maximum number of concurrent tasks during 84 + one build. It affects, e.g., -j option for make. The default is 1. 85 + Some builds may become non-deterministic with this option; use with 86 + care! Packages will only be affected if enableParallelBuilding is 87 + set for them. 88 + ''; 75 89 }; 76 90 77 91 useChroot = mkOption {