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:
+2
-5
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user