aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-16 15:11:17 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-04-16 15:11:17 +0200
commit8c4e759efd779e80d135516fdce2cf884a2e06f5 (patch)
tree9244c1b06e6cb67f5ff0ac6eb61cdcd5b4a69e4c /src/libexpr
parentcfca793a20862220c53094ee63523c9a09d2c9a3 (diff)
updateLockFile(): Make sure Git can see flake.lock
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops/flake.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc
index 37dadd474..13928d9d5 100644
--- a/src/libexpr/primops/flake.cc
+++ b/src/libexpr/primops/flake.cc
@@ -399,6 +399,10 @@ void updateLockFile(EvalState & state, const Path & path)
FlakeRef flakeRef = FlakeRef("file://" + path); // FIXME: ugly
auto lockFile = makeLockFile(state, flakeRef);
writeLockFile(lockFile, path + "/flake.lock");
+
+ // Hack: Make sure that flake.lock is visible to Git. Otherwise,
+ // exportGit will fail to copy it to the Nix store.
+ runProgram("git", true, { "-C", path, "add", "flake.lock" });
}
void callFlake(EvalState & state, const Dependencies & flake, Value & v)