1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

skip ifds in nix flake show instead of throwing

This commit is contained in:
Uluc Sengil 2025-02-28 19:53:41 +01:00 committed by Jörg Thalheim
parent 77f22db567
commit fcf5966488
6 changed files with 69 additions and 15 deletions

View file

@ -110,5 +110,6 @@ template class EvalErrorBuilder<UndefinedVarError>;
template class EvalErrorBuilder<MissingArgumentError>;
template class EvalErrorBuilder<InfiniteRecursionError>;
template class EvalErrorBuilder<InvalidPathError>;
template class EvalErrorBuilder<IFDError>;
}

View file

@ -54,6 +54,7 @@ MakeError(TypeError, EvalError);
MakeError(UndefinedVarError, EvalError);
MakeError(MissingArgumentError, EvalError);
MakeError(InfiniteRecursionError, EvalError);
MakeError(IFDError, EvalBaseError);
struct InvalidPathError : public EvalError
{

View file

@ -91,7 +91,7 @@ StringMap EvalState::realiseContext(const NixStringContext & context, StorePathS
if (drvs.empty()) return {};
if (isIFD && !settings.enableImportFromDerivation)
error<EvalBaseError>(
error<IFDError>(
"cannot build '%1%' during evaluation because the option 'allow-import-from-derivation' is disabled",
drvs.begin()->to_string(*store)
).debugThrow();