diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-02-03 14:06:53 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-02-03 14:15:39 +0100 |
commit | 44d642116087d9f22e01b457f076cc3c3a739a9d (patch) | |
tree | 9fd88c533047f4229068c795105338f5eb6a964f /src/libexpr | |
parent | d5334c466b9ee237a1cce4fd005d790e67d74822 (diff) |
Emit narHash attribute
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/flake/flake.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc index 5018b460b..a0f41e6b9 100644 --- a/src/libexpr/flake/flake.cc +++ b/src/libexpr/flake/flake.cc @@ -616,6 +616,10 @@ static void emitSourceInfoAttrs( auto pathS = state.store->printStorePath(sourceInfo.storePath); mkString(*state.allocAttr(vAttrs, state.sOutPath), pathS, {pathS}); + assert(sourceInfo.info.narHash); + mkString(*state.allocAttr(vAttrs, state.symbols.create("narHash")), + sourceInfo.info.narHash.to_string(SRI)); + if (auto rev = flakeRef.input->getRev()) { mkString(*state.allocAttr(vAttrs, state.symbols.create("rev")), rev->gitRev()); |