1# Installing behind a proxy {#sec-installing-behind-proxy} 2 3To install NixOS behind a proxy, do the following before running 4`nixos-install`. 5 61. Update proxy configuration in `/mnt/etc/nixos/configuration.nix` to 7 keep the internet accessible after reboot. 8 9 ```nix 10 { 11 networking.proxy.default = "http://user:password@proxy:port/"; 12 networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 13 } 14 ``` 15 161. Setup the proxy environment variables in the shell where you are 17 running `nixos-install`. 18 19 ```ShellSession 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" 25 ``` 26 27::: {.note} 28If you are switching networks with different proxy configurations, use 29the `specialisation` option in `configuration.nix` to switch proxies at 30runtime. Refer to [](#ch-options) for more information. 31:::