git.iko.soy/typeable/nixpkgs
on master help sign in
nix-daemon: add maxCores option
e8dace2Nikolay Amiantov
nixos/modules/services/misc/nix-daemon.nix+14
@@ -36,6 +36,7 @@ let
36 # /etc/nixos/configuration.nix. Do not edit it!
36 # /etc/nixos/configuration.nix. Do not edit it!
37 build-users-group = nixbld
37 build-users-group = nixbld
38 build-max-jobs = ${toString (cfg.maxJobs)}
38 build-max-jobs = ${toString (cfg.maxJobs)}
39+ build-cores = ${toString (cfg.buildCores)}
39 build-use-chroot = ${if cfg.useChroot then "true" else "false"}
40 build-use-chroot = ${if cfg.useChroot then "true" else "false"}
40 build-chroot-dirs = ${toString cfg.chrootDirs} /bin/sh=${sh} $(echo $extraPaths)
41 build-chroot-dirs = ${toString cfg.chrootDirs} /bin/sh=${sh} $(echo $extraPaths)
41 binary-caches = ${toString cfg.binaryCaches}
42 binary-caches = ${toString cfg.binaryCaches}
@@ -74,6 +75,19 @@ in
74 ";
75 ";
75 };
76 };
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+ '';
89+ };
90+
77 useChroot = mkOption {
91 useChroot = mkOption {
78 type = types.bool;
92 type = types.bool;
79 default = false;
93 default = false;