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

Merge pull request #12759 from roberth/c-api-libflake-settings

C API / settings: remove nix-flake-c global init
This commit is contained in:
John Ericson 2025-03-27 12:38:25 -04:00 committed by GitHub
commit a26a15d05c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 277 additions and 189 deletions

View file

@ -4675,7 +4675,7 @@ RegisterPrimOp::RegisterPrimOp(PrimOp && primOp)
}
void EvalState::createBaseEnv()
void EvalState::createBaseEnv(const EvalSettings & evalSettings)
{
baseEnv.up = 0;
@ -4934,6 +4934,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.