* Set build-max-jobs in the Nix configuration file from the NixOS

configuration file.

svn path=/nixos/trunk/; revision=8109
This commit is contained in:
Eelco Dolstra 2007-02-28 16:58:35 +00:00
parent 935042365c
commit 31d91b4ec1
3 changed files with 16 additions and 1 deletions

View File

@ -91,7 +91,9 @@ if test -z "@readOnlyRoot@"; then
mkdir -p /nix/etc/nix mkdir -p /nix/etc/nix
cat > /nix/etc/nix/nix.conf <<EOF cat > /nix/etc/nix/nix.conf <<EOF
# WARNING: this file is generated.
build-users-group = nixbld build-users-group = nixbld
build-max-jobs = @maxJobs@
EOF EOF
chown root.nixbld /nix/store chown root.nixbld /nix/store

View File

@ -663,6 +663,19 @@
} }
{
name = ["nix" "maxJobs"];
default = 1;
example = 2;
description = "
This option defines the maximum number of jobs that Nix will try
to build in parallel. The default is 1. You should generally
set it to the number of CPUs in your system (e.g., 2 on a Athlon
64 X2).
";
}
{ {
name = ["security" "setuidPrograms"]; name = ["security" "setuidPrograms"];
default = ["passwd" "su" "crontab" "ping" "ping6"]; default = ["passwd" "su" "crontab" "ping" "ping6"];

View File

@ -224,13 +224,13 @@ rec {
readOnlyRoot = config.get ["boot" "readOnlyRoot"]; readOnlyRoot = config.get ["boot" "readOnlyRoot"];
hostName = config.get ["networking" "hostName"]; hostName = config.get ["networking" "hostName"];
setuidPrograms = config.get ["security" "setuidPrograms"]; setuidPrograms = config.get ["security" "setuidPrograms"];
maxJobs = config.get ["nix" "maxJobs"];
path = [ path = [
pkgs.coreutils pkgs.gnugrep pkgs.findutils pkgs.coreutils pkgs.gnugrep pkgs.findutils
pkgs.glibc # needed for getent pkgs.glibc # needed for getent
pkgs.pwdutils pkgs.pwdutils
]; ];
}; };