at 18.09-beta 1.6 kB view raw
1<section xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude" 4 version="5.0" 5 xml:id="sec-installing-behind-proxy"> 6 <title>Installing behind a proxy</title> 7 8<para> 9 To install NixOS behind a proxy, do the following before running 10 <literal>nixos-install</literal>. 11</para> 12<orderedlist numeration="arabic"> 13 <listitem> 14 <para> 15 Update proxy configuration in 16 <literal>/mnt/etc/nixos/configuration.nix</literal> to keep the 17 internet accessible after reboot. 18 </para> 19 <programlisting> 20networking.proxy.default = &quot;http://user:password@proxy:port/&quot;; 21networking.proxy.noProxy = &quot;127.0.0.1,localhost,internal.domain&quot;; 22</programlisting> 23 </listitem> 24 <listitem> 25 <para> 26 Setup the proxy environment variables in the shell where you are 27 running <literal>nixos-install</literal>. 28 </para> 29 <programlisting> 30# proxy_url=&quot;http://user:password@proxy:port/&quot; 31# export http_proxy=&quot;$proxy_url&quot; 32# export HTTP_PROXY=&quot;$proxy_url&quot; 33# export https_proxy=&quot;$proxy_url&quot; 34# export HTTPS_PROXY=&quot;$proxy_url&quot; 35</programlisting> 36 </listitem> 37</orderedlist> 38 39<note> 40<para> 41 If you are switching networks with different proxy configurations, use the 42 <literal>nesting.clone</literal> option in 43 <literal>configuration.nix</literal> to switch proxies at runtime. 44 Refer to <xref linkend="ch-options" /> for more information. 45</para> 46</note> 47</section>