[Nix-dev] [PATCH] pass NUM_CORES to the Nix daemon. You can override this setting in nix.conf

Marc Weber marco-oweber at gmx.de
Tue Jun 8 02:27:51 CEST 2010


---
 modules/services/misc/nix-daemon.nix |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix
index 214e091..c801455 100644
--- a/modules/services/misc/nix-daemon.nix
+++ b/modules/services/misc/nix-daemon.nix
@@ -242,6 +242,7 @@ in
           ''
             export PATH=${if config.nix.distributedBuilds then "${pkgs.openssh}/bin:${pkgs.gzip}/bin:" else ""}${pkgs.openssl}/bin:${nix}/bin:$PATH
             ${config.nix.envVars}
+            export NUM_CORES=$(${pkgs.coreutils}/bin/nproc)
             exec \
               nice -n ${builtins.toString config.nix.daemonNiceLevel} \
               ${pkgs.utillinux}/bin/ionice -n ${builtins.toString config.nix.daemonIONiceLevel} \
-- 
1.6.6.2




More information about the nix-dev mailing list