Skip to content

Commit 9df278c

Browse files
committed
Add makeFixedOutputCA
1 parent 08f6be3 commit 9df278c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module System.Nix.ReadonlyStore where
77
import Data.ByteString (ByteString)
88
import qualified Data.ByteString as BS
99
import qualified Data.HashSet as HS
10+
import Data.Text (Text)
1011
import Data.Text.Encoding
1112
import System.Nix.Hash
1213
import System.Nix.StorePath
@@ -37,5 +38,9 @@ makeFixedOutputPath recursive h nm =
3738
then ("source", h)
3839
else ("output:out", hash ("fixed:out:" <> encodeUtf8 (encodeBase16 h) <> ":"))
3940

41+
makeFixedOutputCA :: Bool -> Digest hashAlgo -> Text
42+
makeFixedOutputCA recursive h =
43+
"fixed:" <> (if recursive then "r:" else "") <> encodeBase16 h
44+
4045
computeStorePathForText :: (KnownStoreDir storeDir) => StorePathName -> ByteString -> StorePathSet storeDir -> StorePath storeDir
4146
computeStorePathForText nm s refs = makeTextPath nm (hash s) refs

0 commit comments

Comments
 (0)