mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 20:46:01 +01:00
Fix nix flake init eval for path value
This commit is contained in:
parent
f3d2a16eff
commit
f13dc79904
1 changed files with 4 additions and 1 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
#include "markdown.hh"
|
#include "markdown.hh"
|
||||||
#include "users.hh"
|
#include "users.hh"
|
||||||
#include "terminal.hh"
|
#include "terminal.hh"
|
||||||
|
#include "value/context.hh"
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
@ -884,7 +885,9 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
|
||||||
auto cursor = installable.getCursor(*evalState);
|
auto cursor = installable.getCursor(*evalState);
|
||||||
|
|
||||||
auto templateDirAttr = cursor->getAttr("path");
|
auto templateDirAttr = cursor->getAttr("path");
|
||||||
auto templateDir = templateDirAttr->getString();
|
auto & v = templateDirAttr->forceValue();
|
||||||
|
NixStringContext ctx;
|
||||||
|
auto templateDir = evalState->coerceToString(noPos, v, ctx, "while casting the template value to a path", false, true).toOwned();
|
||||||
|
|
||||||
if (!store->isInStore(templateDir))
|
if (!store->isInStore(templateDir))
|
||||||
evalState->error<TypeError>(
|
evalState->error<TypeError>(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue