1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

nix-expr: Add primops to EvalSettings

This commit is contained in:
Robert Hensing 2025-03-26 08:55:44 +00:00
parent 9b0f455609
commit 3c4c0953e0
5 changed files with 30 additions and 3 deletions

View file

@ -4669,7 +4669,7 @@ RegisterPrimOp::RegisterPrimOp(PrimOp && primOp)
}
void EvalState::createBaseEnv()
void EvalState::createBaseEnv(const EvalSettings & evalSettings)
{
baseEnv.up = 0;
@ -4928,6 +4928,12 @@ void EvalState::createBaseEnv()
addPrimOp(std::move(primOpAdjusted));
}
for (auto & primOp : evalSettings.extraPrimOps) {
auto primOpAdjusted = primOp;
primOpAdjusted.arity = std::max(primOp.args.size(), primOp.arity);
addPrimOp(std::move(primOpAdjusted));
}
/* Add a wrapper around the derivation primop that computes the
`drvPath' and `outPath' attributes lazily.