diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-07-22 23:17:48 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-07-23 18:26:48 +0200 |
commit | ef606760abd87c98371fbc08c1f25ad897823a2a (patch) | |
tree | a1f5c77f1302c7cf3b2b1a8945b175d8cde77c66 /doc/manual/src/installation/env-variables.md | |
parent | d004715665046ff424f267deccccb78c9d5cabb7 (diff) |
Pandoc conversion
Diffstat (limited to 'doc/manual/src/installation/env-variables.md')
-rw-r--r-- | doc/manual/src/installation/env-variables.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/doc/manual/src/installation/env-variables.md b/doc/manual/src/installation/env-variables.md new file mode 100644 index 000000000..7946ac437 --- /dev/null +++ b/doc/manual/src/installation/env-variables.md @@ -0,0 +1,56 @@ +# Environment Variables + +To use Nix, some environment variables should be set. In particular, +PATH should contain the directories `prefix/bin` and +`~/.nix-profile/bin`. The first directory contains the Nix tools +themselves, while `~/.nix-profile` is a symbolic link to the current +*user environment* (an automatically generated package consisting of +symlinks to installed packages). The simplest way to set the required +environment variables is to include the file +`prefix/etc/profile.d/nix.sh` in your `~/.profile` (or similar), like +this: + + source prefix/etc/profile.d/nix.sh + +# NIX\_SSL\_CERT\_FILE + +If you need to specify a custom certificate bundle to account for an +HTTPS-intercepting man in the middle proxy, you must specify the path to +the certificate bundle in the environment variable NIX\_SSL\_CERT\_FILE. + +If you don't specify a NIX\_SSL\_CERT\_FILE manually, Nix will install +and use its own certificate bundle. + +Set the environment variable and install Nix + + $ export NIX_SSL_CERT_FILE=/etc/ssl/my-certificate-bundle.crt + $ sh <(curl -L https://nixos.org/nix/install) + +In the shell profile and rc files (for example, `/etc/bashrc`, +`/etc/zshrc`), add the following line: + + export NIX_SSL_CERT_FILE=/etc/ssl/my-certificate-bundle.crt + +> **Note** +> +> You must not add the export and then do the install, as the Nix +> installer will detect the presense of Nix configuration, and abort. + +## NIX\_SSL\_CERT\_FILE with macOS and the Nix daemon + +On macOS you must specify the environment variable for the Nix daemon +service, then restart it: + + $ sudo launchctl setenv NIX_SSL_CERT_FILE /etc/ssl/my-certificate-bundle.crt + $ sudo launchctl kickstart -k system/org.nixos.nix-daemon + +## Proxy Environment Variables + +The Nix installer has special handling for these proxy-related +environment variables: `http_proxy`, `https_proxy`, `ftp_proxy`, +`no_proxy`, `HTTP_PROXY`, `HTTPS_PROXY`, `FTP_PROXY`, `NO_PROXY`. + +If any of these variables are set when running the Nix installer, then +the installer will create an override file at +`/etc/systemd/system/nix-daemon.service.d/override.conf` so `nix-daemon` +will use them. |