Update lock files from InstallableFlake::toValue()

This ensures that the lock file is updated *before* evaluating it, and
that it gets updated for any nix command, not just 'nix build'.

Also, while computing the lock file, allow arbitrary registry lookups,
not just at top-level.

Also, improve some error messages slightly.
This commit is contained in:
Eelco Dolstra
2019-04-16 15:02:02 +02:00
parent 7b312a8762
commit 60834492ae
6 changed files with 40 additions and 53 deletions
+2 -5
View File
@@ -66,11 +66,6 @@ struct Installable
Buildable toBuildable();
virtual std::optional<std::string> installableToFlakeUri()
{
return std::nullopt;
}
virtual Value * toValue(EvalState & state)
{
throw Error("argument '%s' cannot be evaluated", what());
@@ -81,6 +76,8 @@ struct SourceExprCommand : virtual Args, StoreCommand, MixEvalArgs
{
std::optional<Path> file;
bool updateLockFile = true;
SourceExprCommand();
ref<EvalState> getEvalState();