1<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-nix-network-issues">
2 <title>Network Problems</title>
3 <para>
4 Nix uses a so-called <emphasis>binary cache</emphasis> to optimise
5 building a package from source into downloading it as a pre-built
6 binary. That is, whenever a command like
7 <literal>nixos-rebuild</literal> needs a path in the Nix store, Nix
8 will try to download that path from the Internet rather than build
9 it from source. The default binary cache is
10 <literal>https://cache.nixos.org/</literal>. If this cache is
11 unreachable, Nix operations may take a long time due to HTTP
12 connection timeouts. You can disable the use of the binary cache by
13 adding <literal>--option use-binary-caches false</literal>, e.g.
14 </para>
15 <programlisting>
16# nixos-rebuild switch --option use-binary-caches false
17</programlisting>
18 <para>
19 If you have an alternative binary cache at your disposal, you can
20 use it instead:
21 </para>
22 <programlisting>
23# nixos-rebuild switch --option binary-caches http://my-cache.example.org/
24</programlisting>
25</section>