Skip to content

Commit f31dc6c

Browse files
committed
Add makeFixedOutputCA
1 parent 3ef34c7 commit f31dc6c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hnix-store-core/src/System/Nix/ReadonlyStore.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ makeFixedOutputPath storeDir recursive h nm =
3131
(ty, h') =
3232
if recursive
3333
then ("source", h)
34-
else ("output:out", hash ("fixed:out:" <> encodeUtf8 (digestText16 h) <> ":"))
34+
else ("output:out", hash @'SHA256 ("fixed:out:" <> encodeUtf8 (digestText16 h) <> ":"))
35+
36+
makeFixedOutputCA :: Bool -> Digest 'SHA256 -> Text
37+
makeFixedOutputCA recursive h =
38+
"fixed:" <> (if recursive then "r:" else "") <> digestText32 h
3539

3640
makeTextPath :: Text -> Text -> Digest 'SHA256 -> PathSet -> Path
3741
makeTextPath storeDir nm h refs = makeStorePath storeDir ty h nm

0 commit comments

Comments
 (0)