1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 13:31:48 +02:00

Add '--no-net' convenience flag

This flag

* Disables substituters.

* Sets the tarball-ttl to infinity (ensuring e.g. that the flake
  registry and any downloaded flakes are considered current).

* Disables retrying downloads and sets the connection timeout to the
  minimum. (So it doesn't completely disable downloads at the moment.)

(cherry picked from commit 8ea842260b)
This commit is contained in:
Eelco Dolstra 2019-06-17 08:43:45 +02:00
parent 78fa47a7f0
commit 7b9c68766d
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
5 changed files with 35 additions and 20 deletions

View file

@ -29,23 +29,7 @@ using namespace std::string_literals;
namespace nix {
struct DownloadSettings : Config
{
Setting<bool> enableHttp2{this, true, "http2",
"Whether to enable HTTP/2 support."};
Setting<std::string> userAgentSuffix{this, "", "user-agent-suffix",
"String appended to the user agent in HTTP requests."};
Setting<size_t> httpConnections{this, 25, "http-connections",
"Number of parallel HTTP connections.",
{"binary-caches-parallel-connections"}};
Setting<unsigned long> connectTimeout{this, 0, "connect-timeout",
"Timeout for connecting to servers during downloads. 0 means use curl's builtin default."};
};
static DownloadSettings downloadSettings;
DownloadSettings downloadSettings;
static GlobalConfig::Register r1(&downloadSettings);