about summary refs log tree commit diff
path: root/corepkgs/buildenv
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-08-04T12·13+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-08-04T12·13+0000
commit7f893b7a43fdca728fd1f7a72e51d31d2a6e7147 (patch)
tree16c0e1f63820e841d211c6280e42da181bc80566 /corepkgs/buildenv
parent87ef5907e97f455bd4064f4d6e5f3c972402a8b9 (diff)
* Allow derivations to hint that they should not be built remotely
  using the build hook mechanism, by setting the derivation attribute
  "preferLocalBuild" to true.  This has a few use cases:

  - The user environment builder.  Since it just creates a bunch of
    symlinks without much computation, there is no reason to do it
    remotely.  In fact, doing it remotely requires the entire closure
    of the user environment to be copied to the remote machine, which
    is extremely wasteful.

  - `fetchurl'.  Performing the download on a remote machine and then
    copying it to the local machine involves twice as much network
    traffic as performing the download locally, and doesn't save any
    CPU cycles on the local machine.

Diffstat (limited to 'corepkgs/buildenv')
-rw-r--r--corepkgs/buildenv/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/corepkgs/buildenv/default.nix b/corepkgs/buildenv/default.nix
index 36dd9d0c6a0a..d76f5274099a 100644
--- a/corepkgs/buildenv/default.nix
+++ b/corepkgs/buildenv/default.nix
@@ -11,4 +11,8 @@ derivation {
   paths = derivations;
   active = map (x: if x ? meta && x.meta ? active then x.meta.active else "true") derivations;
   priority = map (x: if x ? meta && x.meta ? priority then x.meta.priority else "5") derivations;
+
+  # Building user environments remotely just causes huge amounts of
+  # network traffic, so don't do that.
+  preferLocalBuild = true;
 }