2014-08-24 18:18:18 +01:00
|
|
|
<section xmlns="http://docbook.org/ns/docbook"
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
|
|
version="5.0"
|
|
|
|
xml:id="sec-nix-network-issues">
|
|
|
|
|
|
|
|
<title>Network Problems</title>
|
|
|
|
|
|
|
|
<para>Nix uses a so-called <emphasis>binary cache</emphasis> to
|
|
|
|
optimise building a package from source into downloading it as a
|
|
|
|
pre-built binary. That is, whenever a command like
|
|
|
|
<command>nixos-rebuild</command> needs a path in the Nix store, Nix
|
|
|
|
will try to download that path from the Internet rather than build it
|
|
|
|
from source. The default binary cache is
|
2014-12-09 12:27:00 +00:00
|
|
|
<uri>https://cache.nixos.org/</uri>. If this cache is unreachable,
|
|
|
|
Nix operations may take a long time due to HTTP connection timeouts.
|
|
|
|
You can disable the use of the binary cache by adding <option>--option
|
2014-08-24 18:18:18 +01:00
|
|
|
use-binary-caches false</option>, e.g.
|
|
|
|
|
|
|
|
<screen>
|
2016-06-01 15:23:32 +01:00
|
|
|
# nixos-rebuild switch --option use-binary-caches false
|
2014-08-24 18:18:18 +01:00
|
|
|
</screen>
|
|
|
|
|
|
|
|
If you have an alternative binary cache at your disposal, you can use
|
|
|
|
it instead:
|
|
|
|
|
|
|
|
<screen>
|
2016-06-01 15:23:32 +01:00
|
|
|
# nixos-rebuild switch --option binary-caches http://my-cache.example.org/
|
2014-08-24 18:18:18 +01:00
|
|
|
</screen>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2014-12-09 12:27:00 +00:00
|
|
|
</section>
|