nixos/doc: add instructions for installation behind a proxy (#45854)
The instructions to install nixos behind a proxy were not clear. While one could guess that setting http_proxy variables can get the install rolling, one could end up with an installed system where the proxy settings for the nix-daemon are not configured. This commit updates the documentation with 1. steps to install behind a proxy 2. configure the global proxy settings so that nix-daemon can access internet. 3. Pointers to use nesting.clone in case one has to use different proxy settings on different networks.wip/yesman
parent
ff679f86a2
commit
cb1ca42009
@ -0,0 +1,47 @@ |
||||
<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 = "http://user:password@proxy:port/"; |
||||
networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; |
||||
</programlisting> |
||||
</listitem> |
||||
<listitem> |
||||
<para> |
||||
Setup the proxy environment variables in the shell where you are |
||||
running <literal>nixos-install</literal>. |
||||
</para> |
||||
<programlisting> |
||||
# proxy_url="http://user:password@proxy:port/" |
||||
# export http_proxy="$proxy_url" |
||||
# export HTTP_PROXY="$proxy_url" |
||||
# export https_proxy="$proxy_url" |
||||
# export HTTPS_PROXY="$proxy_url" |
||||
</programlisting> |
||||
</listitem> |
||||
</orderedlist> |
||||
|
||||
<note> |
||||
<para> |
||||
If you are switching networks with different proxy configurations, use the |
||||
<literal>nesting.clone</literal> option in |
||||
<literal>configuration.nix</literal> to switch proxies at runtime. |
||||
Refer to <xref linkend="ch-options" /> for more information. |
||||
</para> |
||||
</note> |
||||
</section> |
Loading…
Reference in new issue