1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Merge branch 'allow-import-from-derivation' of https://github.com/shlevy/nix

This commit is contained in:
Eelco Dolstra 2017-03-09 13:36:30 +01:00
commit 86227390c5
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 17 additions and 0 deletions

View file

@ -59,6 +59,8 @@ void EvalState::realiseContext(const PathSet & context)
drvs.insert(decoded.first + "!" + decoded.second);
}
if (!drvs.empty()) {
if (!settings.enableImportFromDerivation)
throw EvalError(format("attempted to realize %1% during evaluation but 'allow-import-from-derivation' is false") % *(drvs.begin()));
/* For performance, prefetch all substitute info. */
PathSet willBuild, willSubstitute, unknown;
unsigned long long downloadSize, narSize;

View file

@ -70,6 +70,7 @@ Settings::Settings()
enableImportNative = false;
netrcFile = fmt("%s/%s", nixConfDir, "netrc");
caFile = getEnv("NIX_SSL_CERT_FILE", getEnv("SSL_CERT_FILE", "/etc/ssl/certs/ca-certificates.crt"));
enableImportFromDerivation = true;
}
@ -185,6 +186,7 @@ void Settings::update()
_get(keepGoing, "keep-going");
_get(keepFailed, "keep-failed");
_get(netrcFile, "netrc-file");
_get(enableImportFromDerivation, "allow-import-from-derivation");
}

View file

@ -198,6 +198,9 @@ struct Settings {
/* Path to the SSL CA file used */
Path caFile;
/* Whether we allow import-from-derivation */
bool enableImportFromDerivation;
private:
SettingsMap settings, overrides;