Home Explore Blog Models CI



nixpkgs

doc/functions/prefer-remote-fetch.section.md
44cf50cd4185bd13d6bd63e2b3053176c4cea2484f2fba59000000030000028f
# prefer-remote-fetch overlay {#sec-prefer-remote-fetch}

`prefer-remote-fetch` is an overlay that downloads sources on a 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 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
```

Chunks
6faa0580 (1st chunk of `doc/functions/prefer-remote-fetch.section.md`)
Title: Prefer Remote Fetch Overlay for Nixpkgs
Summary
The `prefer-remote-fetch` overlay for Nixpkgs allows sources to be downloaded directly by a remote builder, which is beneficial when the local machine has slow upload speeds but the builder can fetch data faster. To implement it, add a simple `self: super: (super.prefer-remote-fetch self super)` snippet as a new overlay in your Nixpkgs configuration, for example, by saving it to `~/.config/nixpkgs/overlays/prefer-remote-fetch.nix`.