Home Explore Blog CI



nixpkgs

1st chunk of `doc/functions/prefer-remote-fetch.section.md`
f1ea2ce4d6db835e8f2d8362ee383faafc29467e07b6d4850000000100000290
# prefer-remote-fetch overlay {#sec-prefer-remote-fetch}

`prefer-remote-fetch` is an overlay that download sources on remote builder. This is useful when the evaluating machine has a slow upload while the builder can fetch faster directly from the source. To use it, put the following snippet as a new overlay:

```nix
self: super: (super.prefer-remote-fetch self super)
```

A full configuration example for that sets the overlay up for your own account, could look like this

```ShellSession
$ mkdir ~/.config/nixpkgs/overlays/
$ cat > ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix <<EOF
  self: super: super.prefer-remote-fetch self super
EOF
```

Title: prefer-remote-fetch Overlay: Downloading Sources on Remote Builder
Summary
The `prefer-remote-fetch` overlay enables the downloading of sources on a remote builder, which is beneficial when the evaluating machine has a slow upload speed while the builder can fetch sources faster. The provided code snippets demonstrate how to implement this overlay in your Nix configuration.