From 03f2847054901c93edd2a1c6613625e8efca3d17 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Apr 2012 15:19:23 +0000 Subject: [PATCH] * Set preferLocalBuild on a few trivial top-level derivations. These tend to cause a lot of unnecessary I/O to the build machines. svn path=/nixos/trunk/; revision=33936 --- modules/system/activation/top-level.nix | 1 + modules/system/upstart/upstart.nix | 2 +- modules/virtualisation/qemu-vm.nix | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/system/activation/top-level.nix b/modules/system/activation/top-level.nix index 6ebc1fd68e1a..9557c12aca78 100644 --- a/modules/system/activation/top-level.nix +++ b/modules/system/activation/top-level.nix @@ -147,6 +147,7 @@ let # and makes it bootable. system = pkgs.stdenv.mkDerivation { name = "nixos-${config.system.nixosVersion}"; + preferLocalBuild = true; buildCommand = systemBuilder; inherit children; kernelParams = diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix index 5a5f6016b57c..1bfde9fc60ee 100644 --- a/modules/system/upstart/upstart.nix +++ b/modules/system/upstart/upstart.nix @@ -135,7 +135,7 @@ let in pkgs.runCommand ("upstart-" + job.name + ".conf") - { inherit (job) buildHook; inherit jobText; } + { inherit (job) buildHook; inherit jobText; preferLocalBuild = true; } '' eval "$buildHook" echo "$jobText" > $out diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 9596822cd8f6..add88753f009 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -184,6 +184,7 @@ let { exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) config.virtualisation.pathsInNixDB; buildInputs = [ pkgs.perl ]; + preferLocalBuild = true; } '' printRegistration=1 perl ${pkgs.pathsFromGraph} closure-* > $out @@ -353,7 +354,7 @@ in # Don't run ntpd in the guest. It should get the correct time from KVM. services.ntp.enable = false; - system.build.vm = pkgs.runCommand "nixos-vm" {} + system.build.vm = pkgs.runCommand "nixos-vm" { preferLocalBuild = true; } '' ensureDir $out/bin ln -s ${config.system.build.toplevel} $out/system