prefer-fetch-remote: an overlay to fetch on remote builders

This is useful when running tools like NixOps or nix-review
on workstations where the upload to the builder is significantly
slower then downloading the source on the builder itself.
This commit is contained in:
Jörg Thalheim
2019-01-18 14:41:10 +00:00
parent 487d2a7ccd
commit eac6797380
9 changed files with 72 additions and 13 deletions
+4 -4
View File
@@ -14,6 +14,7 @@
, meta ? {}
, port ? "8080"
, postFetch ? ""
, preferLocalBuild ? true
}:
assert sha512 != "" -> builtins.compareVersions "1.11" builtins.nixVersion <= 0;
@@ -42,11 +43,10 @@ if (!hasHash) then throw "Specify sha for fetchipfs fixed-output derivation" els
postFetch
ipfs
url
port;
port
meta;
# Doing the download on a remote machine just duplicates network
# traffic, so don't do that.
preferLocalBuild = true;
inherit meta;
inherit preferLocalBuild;
}