Add effect for adding file to store

This commit is contained in:
Alex Rozenshteyn 2018-04-29 13:55:48 -07:00
parent 972e2c706f
commit cf214ad2c3
2 changed files with 4 additions and 1 deletions

View File

@ -22,6 +22,6 @@ library
-- Drop foundation when we can drop cryptonite <0.25
cryptonite, memory, foundation, basement,
text, regex-base, regex-tdfa-text,
hashable, unordered-containers
hashable, unordered-containers, bytestring
hs-source-dirs: src
default-language: Haskell2010

View File

@ -14,6 +14,7 @@ module System.Nix.Store
import Crypto.Hash (Digest)
import Crypto.Hash.Truncated (Truncated)
import Crypto.Hash.Algorithms (SHA256)
import qualified Data.ByteString as BS
import qualified Data.ByteArray as B
import Data.Text (Text)
import Text.Regex.Base.RegexLike (makeRegex, matchTest)
@ -109,4 +110,6 @@ data StoreEffects rootedPath validPath m =
derivationOutputNames :: !(validPath -> m (HashSet Text))
, -- | Get a full 'Path' corresponding to a given 'Digest'.
pathFromHashPart :: !(Digest PathHashAlgo -> m Path)
, -- | Add a non-nar file to the store
addFile :: !(BS.ByteString -> m validPath)
}