1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-22 10:19:36 +01:00

Put the builder context in a struct

This commit is contained in:
Eelco Dolstra 2025-05-01 12:46:40 +02:00
parent 40bbad3be5
commit fe0124fe17
5 changed files with 40 additions and 51 deletions

View file

@ -167,17 +167,15 @@ void buildProfile(const Path & out, Packages && pkgs)
debug("created %d symlinks in user environment", state.symlinks);
}
static void builtinBuildenv(
const BasicDerivation & drv,
const std::map<std::string, Path> & outputs)
static void builtinBuildenv(const BuiltinBuilderContext & ctx)
{
auto getAttr = [&](const std::string & name) {
auto i = drv.env.find(name);
if (i == drv.env.end()) throw Error("attribute '%s' missing", name);
auto i = ctx.drv.env.find(name);
if (i == ctx.drv.env.end()) throw Error("attribute '%s' missing", name);
return i->second;
};
auto out = outputs.at("out");
auto out = ctx.outputs.at("out");
createDirs(out);
/* Convert the stuff we get from the environment back into a