nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1# An overlay that download sources on remote builder.
2# This is useful when the evaluating machine has a slow
3# upload while the builder can fetch faster directly from the source.
4# Usage: Put the following snippet in your usual overlay definition:
5#
6# self: super:
7# (super.prefer-remote-fetch self super)
8# Full configuration example for your own account:
9#
10# $ mkdir ~/.config/nixpkgs/overlays/
11# $ echo 'self: super: super.prefer-remote-fetch self super' > ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix
12#
13self: super:
14let
15 preferLocal =
16 orig:
17 self.lib.extendMkDerivation {
18 constructDrv = orig;
19 extendDrvArgs =
20 finalAttrs:
21 {
22 preferLocalBuild ? false,
23 ...
24 }:
25 {
26 inherit preferLocalBuild;
27 };
28 };
29
30in
31{
32 binary-cache = preferLocal super.binary-cache;
33 buildenv = preferLocal super.buildenv;
34 fetchfossil = preferLocal super.fetchfossil;
35 fetchdocker = preferLocal super.fetchdocker;
36 fetchgit = (preferLocal super.fetchgit) // {
37 inherit (super.fetchgit) getRevWithTag;
38 };
39 fetchgx = preferLocal super.fetchgx;
40 fetchhg = preferLocal super.fetchhg;
41 fetchipfs = preferLocal super.fetchipfs;
42 fetchrepoproject = preferLocal super.fetchrepoproject;
43 fetchs3 = preferLocal super.fetchs3;
44 fetchsvn = preferLocal super.fetchsvn;
45 fetchurl = preferLocal super.fetchurl;
46 mkNugetSource = preferLocal super.mkNugetSource;
47}