2014-08-24 19:18:18 +02: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">
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-01 19:57:09 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 <title>Network Problems</title>
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-24 19:18:18 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-01 19:57:09 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 <para>
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  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
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  <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
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  use-binary-caches false</option>, e.g.
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-24 19:18:18 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<screen>
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-23 00:38:47 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								<prompt># </prompt>nixos-rebuild switch --option use-binary-caches false
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-24 19:18:18 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								</screen>
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  If you have an alternative binary cache at your disposal, you can use it
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  instead:
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-24 19:18:18 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<screen>
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-23 00:38:47 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								<prompt># </prompt>nixos-rebuild switch --option binary-caches <replaceable>http://my-cache.example.org/</replaceable>
							 | 
						
					
						
							
								
									
										
										
										
											2014-08-24 19:18:18 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								</screen>
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-01 19:57:09 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 </para>
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-09 13:27:00 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								</section>
							 |