about summary refs log tree commit diff
path: root/nix.conf.example
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2010-06-23T14·34+0000
committerPeter Simons <simons@cryp.to>2010-06-23T14·34+0000
commit8b7f8b56f11145c1be5188113cbcdbea27e99525 (patch)
tree06e342b8801860283f115e38a9cbafa2394f957e /nix.conf.example
parent819548d92f45d8aea671ca9a3e938ff928679063 (diff)
Added support for passing an (impure) NIX_BUILD_CORES variable to build expressions.
This patch adds the configuration file variable "build-cores" and the
command line argument "--cores". These settings specify the number of
CPU cores to utilize for parallel building within a job, i.e. by passing
an appropriate "-j" flag to GNU Make. The default value is 1, which
means that parallel building is *disabled*. If the number of build cores
is specified as 0 (synonymously: "guess" or "auto"), then the actual
value is supposed to be auto-detected by builders at run-time, i.e by
calling the nproc(1) utility from coreutils.

The environment variable $NIX_BUILD_CORES is available to builders, but
the contents of that variable does *not* influence the hash that goes
into the $out store path, i.e. the number of build cores to be utilized
can be changed at will without requiring any re-builds.
Diffstat (limited to 'nix.conf.example')
-rw-r--r--nix.conf.example12
1 files changed, 12 insertions, 0 deletions
diff --git a/nix.conf.example b/nix.conf.example
index e17cf3c25f60..6175d861491b 100644
--- a/nix.conf.example
+++ b/nix.conf.example
@@ -59,6 +59,18 @@
 #build-max-jobs = 1
 
 
+### Option `build-cores'
+#
+# This option defines the number of CPU cores to utilize in parallel
+# within a build job, i.e. by passing an appropriate `-jN' flag to
+# GNU make. The default is 1, meaning that parallel building within
+# jobs is disabled. Passing the special values `0', `auto', or
+# `guess' causes Nix to try and auto-detect the number of available
+# cores on the local host. This setting can be overridden using the
+# `--cores' command line switch.
+#build-cores = 1
+
+
 ### Option `build-max-silent-time'
 #
 # This option defines the maximum number of seconds that a builder can