aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops/flake.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-16 15:02:02 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-04-16 15:02:02 +0200
commit60834492aea935b8043cdc8ccbc1270edebbc20a (patch)
tree3e58547917e7dfabe6d403c8fd8e4e58db2aaeef /src/libexpr/primops/flake.hh
parent7b312a8762988ff7a8e0f0890fcd2406cd89c1a3 (diff)
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.
Diffstat (limited to 'src/libexpr/primops/flake.hh')
-rw-r--r--src/libexpr/primops/flake.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/primops/flake.hh b/src/libexpr/primops/flake.hh
index 347dd2077..655d87f03 100644
--- a/src/libexpr/primops/flake.hh
+++ b/src/libexpr/primops/flake.hh
@@ -29,7 +29,9 @@ struct LockFile
Path getUserRegistryPath();
-void makeFlakeValue(EvalState & state, const FlakeRef & flakeRef, bool impureTopRef, Value & v);
+enum RegistryAccess { DisallowRegistry, AllowRegistry, AllowRegistryAtTop };
+
+void makeFlakeValue(EvalState & state, const FlakeRef & flakeRef, RegistryAccess registryAccess, Value & v);
std::shared_ptr<FlakeRegistry> readRegistry(const Path &);
@@ -73,9 +75,7 @@ struct Dependencies
Dependencies(const Flake & flake) : flake(flake) {}
};
-Dependencies resolveFlake(EvalState &, const FlakeRef &, bool impureTopRef, bool isTopFlake = true);
-
-FlakeRegistry updateLockFile(EvalState &, const Flake &);
+Dependencies resolveFlake(EvalState &, const FlakeRef &, RegistryAccess registryAccess, bool isTopFlake = true);
void updateLockFile(EvalState &, const Path & path);