summary refs log tree commit diff
path: root/nixos/doc/manual/installation/installing-behind-a-proxy.xml
blob: c1ef638e876ea66e9becd4be7657d338db46d9f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<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>

 <para>
  To install NixOS behind a proxy, do the following before running
  <literal>nixos-install</literal>.
 </para>

 <orderedlist numeration="arabic">
  <listitem>
   <para>
    Update proxy configuration in
    <literal>/mnt/etc/nixos/configuration.nix</literal> to keep the internet
    accessible after reboot.
   </para>
<programlisting>
networking.proxy.default = &quot;http://user:password@proxy:port/&quot;;
networking.proxy.noProxy = &quot;127.0.0.1,localhost,internal.domain&quot;;
</programlisting>
  </listitem>
  <listitem>
   <para>
    Setup the proxy environment variables in the shell where you are running
    <literal>nixos-install</literal>.
   </para>
<programlisting>
# proxy_url=&quot;http://user:password@proxy:port/&quot;
# export http_proxy=&quot;$proxy_url&quot;
# export HTTP_PROXY=&quot;$proxy_url&quot;
# export https_proxy=&quot;$proxy_url&quot;
# export HTTPS_PROXY=&quot;$proxy_url&quot;
</programlisting>
  </listitem>
 </orderedlist>

 <note>
  <para>
   If you are switching networks with different proxy configurations, use the
   <literal>specialisation</literal> option in
   <literal>configuration.nix</literal> to switch proxies at runtime. Refer to
   <xref linkend="ch-options" /> for more information.
  </para>
 </note>
</section>