From dbd6ea7f63ef0d1eb68c142d2da9cda57ac33c93 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sat, 18 Jul 2009 16:14:03 +0000 Subject: adding daemonNiceLevel option. running biulds with niceness 0 can be annoying svn path=/nixos/branches/modular-nixos/; revision=16420 --- modules/services/misc/nix-daemon.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index b8911a8cea3..f3c749ff480 100644 --- a/modules/services/misc/nix-daemon.nix +++ b/modules/services/misc/nix-daemon.nix @@ -63,6 +63,15 @@ let "; }; + + daemonNiceLevel = mkOption { + default = 2; + description = " + nix dameon process priority. This priority propagates to build processes. + 0 is default unix process priority. 20 is lowest. + "; + }; + buildMachines = mkOption { example = [ { hostName = "voila.labs.cs.uu.nl"; @@ -245,7 +254,7 @@ in '' export PATH=${if config.nix.distributedBuilds then "${pkgs.openssh}/bin:" else ""}${pkgs.openssl}/bin:${nix}/bin:$PATH ${config.nix.envVars} - exec ${nix}/bin/nix-worker --daemon > /dev/null 2>&1 + exec nice -n ${builtins.toString config.nix.daemonNiceLevel} ${nix}/bin/nix-worker --daemon > /dev/null 2>&1 ''; }; -- cgit 1.4.1