1 # Installing behind a proxy {#sec-installing-behind-proxy}
3 To install NixOS behind a proxy, do the following before running
6 1. Update proxy configuration in `/mnt/etc/nixos/configuration.nix` to
7 keep the internet accessible after reboot.
11 networking.proxy.default = "http://user:password@proxy:port/";
12 networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
16 1. Setup the proxy environment variables in the shell where you are
17 running `nixos-install`.
20 # proxy_url="http://user:password@proxy:port/"
21 # export http_proxy="$proxy_url"
22 # export HTTP_PROXY="$proxy_url"
23 # export https_proxy="$proxy_url"
24 # export HTTPS_PROXY="$proxy_url"
28 If you are switching networks with different proxy configurations, use
29 the `specialisation` option in `configuration.nix` to switch proxies at
30 runtime. Refer to [](#ch-options) for more information.