Enterprise: Difference between revisions
imported>Bobvanderlinden No edit summary |
imported>Makefu No edit summary |
||
Line 1: | Line 1: | ||
When trying to use Nix and NixOS in corporations there are a number of | When trying to use Nix and NixOS in corporations there are a number of issues one will run into. This page tries to provide a solution to each of these issues. | ||
== Private resources == | == Private resources == | ||
Line 34: | Line 7: | ||
=== fetchurl === | === fetchurl === | ||
<code>fetchurl</code> is used to retrieve HTTP | <code>fetchurl</code> is used to retrieve HTTP resources, but is also used by <code>fetchFromGithub</code>. For private resources this will usually result in an error like the following: | ||
curl: (22) The requested URL returned error: 401 Unauthorized | curl: (22) The requested URL returned error: 401 Unauthorized | ||
Line 45: | Line 18: | ||
password SECRET | password SECRET | ||
Next the netrc file needs to be accessible in the builds. We will configure Nix to allow access to this file directly from the build sandboxes. Edit your <code>/etc/nix/nix.conf</code> file so that it includes the following lines: | Next the netrc file needs to be accessible in the builds. We will configure Nix to allow access to this file directly from the build sandboxes. Edit your <code>/etc/nix/nix.conf</code> file so that it includes the following lines: | ||
Line 61: | Line 33: | ||
}; | }; | ||
} | } | ||
in ... | in | ||
... | |||
Now all fetchurl calls will use the specified netrc file with the credentials of your choice. | Now all fetchurl calls will use the specified netrc file with the credentials of your choice. | ||
== SSL Intercepting Proxy == | |||
As of right now there currently does not seem to be a way to install nix packages via an intercepting proxy, see [https://github.com/NixOS/nix/issues/1896 nix issue #1896] . The proxy itself can be set via the environment variables <code>HTTP_PROXY</code> and <code>HTTPS_PROXY</code>. |