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