diff --git a/src/nix/flake.cc b/src/nix/flake.cc index a278011e3..be972f4f2 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -600,7 +600,8 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand Strings(attrsPathPrefixes), lockFlags); auto flakeValue = installable.toValue(*evalState); - auto templateDir = evalState->forceStringNoCtx(*evalState->getAttrField(*flakeValue.value, {evalState->symbols.create("path")}, flakeValue.pos)); + PathSet context; + auto templateDir = evalState->coerceToString(flakeValue.pos, *evalState->getAttrField(*flakeValue.value, {evalState->symbols.create("path")}, flakeValue.pos), context, false, false); assert(store->isInStore(templateDir));