aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-08 13:38:32 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-05-08 13:38:32 +0200
commit77e1f9010c5328bee16d85661fe359746cb70e40 (patch)
treefa9f8f9d1a95445c5793dba77ca3877b0ac8d7da /src/libexpr
parent0d1c2e5baed2d75c02daa66962bc7863976978fa (diff)
Export missing rev/shortRev attributes
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops/flake.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc
index b451afba4..dc8df7f6f 100644
--- a/src/libexpr/primops/flake.cc
+++ b/src/libexpr/primops/flake.cc
@@ -441,6 +441,8 @@ void callFlake(EvalState & state, const ResolvedFlake & resFlake, Value & v)
state.store->isValidPath(nonFlake.storePath);
mkString(*state.allocAttr(*vNonFlake, state.sOutPath), nonFlake.storePath, {nonFlake.storePath});
+
+ // FIXME: add rev, shortRev, revCount, ...
}
mkString(*state.allocAttr(v, state.sDescription), resFlake.flake.description);
@@ -449,6 +451,13 @@ void callFlake(EvalState & state, const ResolvedFlake & resFlake, Value & v)
state.store->isValidPath(path);
mkString(*state.allocAttr(v, state.sOutPath), path, {path});
+ if (resFlake.flake.resolvedRef.rev) {
+ mkString(*state.allocAttr(v, state.symbols.create("rev")),
+ resFlake.flake.resolvedRef.rev->gitRev());
+ mkString(*state.allocAttr(v, state.symbols.create("shortRev")),
+ resFlake.flake.resolvedRef.rev->gitShortRev());
+ }
+
if (resFlake.flake.revCount)
mkInt(*state.allocAttr(v, state.symbols.create("revCount")), *resFlake.flake.revCount);