mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 01:09:37 +01:00
Fix a runtime type error nix flake init
Forcibly coerce the `path` argument to a string to make it work even if it's a path
This commit is contained in:
parent
7568cbe344
commit
531cc6593a
1 changed files with 2 additions and 1 deletions
|
|
@ -600,7 +600,8 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
|
||||||
Strings(attrsPathPrefixes), lockFlags);
|
Strings(attrsPathPrefixes), lockFlags);
|
||||||
|
|
||||||
auto flakeValue = installable.toValue(*evalState);
|
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));
|
assert(store->isInStore(templateDir));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue