Use nix::ParsedDerivation::getRequiredSystemFeatures()

A slight dedup, and also ensures that floating CA derivations require a
`ca-derivations` experimental feature. This fixes the scheduling issue
that @SuperSandro2000 found.
This commit is contained in:
John Ericson 2024-01-24 21:04:14 -05:00
parent d45e14fd43
commit 07cb5d1b7c

View file

@ -462,10 +462,7 @@ Step::ptr State::createStep(ref<Store> destStore,
step->systemType = step->drv->platform;
{
auto i = step->drv->env.find("requiredSystemFeatures");
StringSet features;
if (i != step->drv->env.end())
features = step->requiredSystemFeatures = tokenizeString<std::set<std::string>>(i->second);
StringSet features = step->requiredSystemFeatures = step->parsedDrv->getRequiredSystemFeatures();
if (step->preferLocalBuild)
features.insert("local");
if (!features.empty()) {