mirror of
https://github.com/NixOS/nix
synced 2025-06-29 02:11:15 +02:00
Automatically use --no-net if there are no network interfaces
(cherry picked from commit 04a5976996
)
This commit is contained in:
parent
5600b070a7
commit
09dde33c19
2 changed files with 55 additions and 11 deletions
|
@ -1,6 +1,5 @@
|
|||
#include "common-args.hh"
|
||||
#include "globals.hh"
|
||||
#include "download.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
@ -45,16 +44,6 @@ MixCommonArgs::MixCommonArgs(const string & programName)
|
|||
settings.set("max-jobs", s);
|
||||
});
|
||||
|
||||
mkFlag()
|
||||
.longName("no-net")
|
||||
.description("disable substituters and consider all previously downloaded files up-to-date")
|
||||
.handler([]() {
|
||||
settings.useSubstitutes = false;
|
||||
settings.tarballTtl = std::numeric_limits<unsigned int>::max();
|
||||
downloadSettings.tries = 0;
|
||||
downloadSettings.connectTimeout = 1;
|
||||
});
|
||||
|
||||
std::string cat = "config";
|
||||
globalConfig.convertToArgs(*this, cat);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue