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 networking.proxy.default = "http://user:password@proxy:port/"; 11 networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 12 ``` 13 141. Setup the proxy environment variables in the shell where you are 15 running `nixos-install`. 16 17 ```ShellSession 18 # proxy_url="http://user:password@proxy:port/" 19 # export http_proxy="$proxy_url" 20 # export HTTP_PROXY="$proxy_url" 21 # export https_proxy="$proxy_url" 22 # export HTTPS_PROXY="$proxy_url" 23 ``` 24 25::: {.note} 26If you are switching networks with different proxy configurations, use 27the `specialisation` option in `configuration.nix` to switch proxies at 28runtime. Refer to [](#ch-options) for more information. 29:::