2018-09-01 19:42:35 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<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-installing-behind-proxy">
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 <title>Installing behind a proxy</title>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 <para>
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  To install NixOS behind a proxy, do the following before running
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  <literal>nixos-install</literal>.
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 </para>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 <orderedlist numeration="arabic">
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-01 19:42:35 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  <listitem>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   <para>
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Update proxy configuration in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    <literal>/mnt/etc/nixos/configuration.nix</literal> to keep the internet
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    accessible after reboot.
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   </para>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<programlisting>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-01 19:42:35 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								networking.proxy.default = "http://user:password@proxy:port/";
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								</programlisting>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  </listitem>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  <listitem>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   <para>
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    Setup the proxy environment variables in the shell where you are running
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    <literal>nixos-install</literal>.
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   </para>
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-23 00:38:47 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								<screen>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<prompt># </prompt>proxy_url="http://user:password@proxy:port/"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<prompt># </prompt>export http_proxy="$proxy_url"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<prompt># </prompt>export HTTP_PROXY="$proxy_url"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<prompt># </prompt>export https_proxy="$proxy_url"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<prompt># </prompt>export HTTPS_PROXY="$proxy_url"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								</screen>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-01 19:42:35 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  </listitem>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 </orderedlist>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-01 19:42:35 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 <note>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  <para>
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   If you are switching networks with different proxy configurations, use the
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-05 17:07:20 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   <literal>specialisation</literal> option in
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   <literal>configuration.nix</literal> to switch proxies at runtime. Refer to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   <xref linkend="ch-options" /> for more information.
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-29 20:51:11 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  </para>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 </note>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-01 19:42:35 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								</section>
							 |