git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #4750 from abbradar/nix-maxcores

Add buildCores option to nix

commitf079cd1721cd50d188f3c32387a074bf00afb34d authorlethalman <lucabru@src.gnome.org> dateSat 1 Nov 2014, 22:01 (12 years ago) parente1d2e1de8dace2
1 file changed+14
nixos/modules/services/misc/nix-daemon.nix+14
nixos/modules/services/misc/nix-daemon.nix+14
@@ -36,6 +36,7 @@ let
3636 # /etc/nixos/configuration.nix. Do not edit it!
3737 build-users-group = nixbld
3838 build-max-jobs = ${toString (cfg.maxJobs)}
39+ build-cores = ${toString (cfg.buildCores)}
3940 build-use-chroot = ${if cfg.useChroot then "true" else "false"}
4041 build-chroot-dirs = ${toString cfg.chrootDirs} /bin/sh=${sh} $(echo $extraPaths)
4142 binary-caches = ${toString cfg.binaryCaches}
@@ -74,6 +75,19 @@ in
7475 ";
7576 };
7677
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+ '';
89+ };
90+
7791 useChroot = mkOption {
7892 type = types.bool;
7993 default = false;