hercules-ci-cnix-store-0.3.3.5: Haskell bindings for Nix's libstore
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hercules.CNix.Store

Synopsis

Documentation

data HashType Source #

See hash.hh

Constructors

MD5 
SHA1 
SHA256 
SHA512 

Instances

Instances details
Show HashType Source # 
Instance details

Defined in Hercules.CNix.Store

Eq HashType Source # 
Instance details

Defined in Hercules.CNix.Store

data Hash Source #

See hash.hh

Constructors

Hash !HashType !ShortByteString 

Instances

Instances details
Show Hash Source # 
Instance details

Defined in Hercules.CNix.Store

Methods

showsPrec :: Int -> Hash -> ShowS #

show :: Hash -> String #

showList :: [Hash] -> ShowS #

Eq Hash Source # 
Instance details

Defined in Hercules.CNix.Store

Methods

(==) :: Hash -> Hash -> Bool #

(/=) :: Hash -> Hash -> Bool #

newtype StorePath Source #

Store-agnostic store path representation: hash and name. Does not have a storedir or subpath inside the store path.

newtype Store Source #

Constructors

Store (Ptr (Ref NixStore)) 

forNonNull :: Applicative m => Ptr a -> (Ptr a -> m b) -> m (Maybe b) Source #

traverseNonNull :: Applicative m => (Ptr a -> m b) -> Ptr a -> m (Maybe b) Source #

withStore :: MonadUnliftIO m => (Store -> m a) -> m a Source #

withStore' :: (Store -> IO r) -> IO r Source #

withStoreFromURI :: MonadUnliftIO m => Text -> (Store -> m r) -> m r Source #

storeDir :: MonadIO m => Store -> m ByteString Source #

Usually "nixstore"

moveStorePath :: Ptr NixStorePath -> IO StorePath Source #

Move ownership of a Ptr NixStorePath into StorePath

moveStorePathMaybe :: Ptr NixStorePath -> IO (Maybe StorePath) Source #

Move ownership of a Ptr NixStorePath into StorePath

parseStorePathBaseName :: ByteString -> IO StorePath Source #

Create StorePath from hash and name.

Throws C++ BadStorePath exception when invalid.

parseStorePath :: Store -> ByteString -> IO StorePath Source #

Parse a complete store path including storeDir into a StorePath.

Throws C++ BadStorePath exception when invalid.

getDerivationFromString Source #

Arguments

:: Store 
-> ByteString

Derivation name (store path name with ".drv" extension removed)

-> ByteString

Contents

-> IO Derivation 

signPath Source #

Arguments

:: Store 
-> Ptr SecretKey

Secret signing key

-> StorePath

Store path

-> IO Bool

False if the signature was already present, True if the signature was added

followLinksToStorePath :: Store -> ByteString -> IO StorePath Source #

Follow symlinks to the store and chop off the parts after the top-level store name

isValidPath :: Store -> StorePath -> IO Bool Source #

Whether a path exists and is registered.

queryPathInfo Source #

Arguments

:: Store 
-> StorePath

Exact store path, not a subpath

-> IO (ForeignPtr (Ref ValidPathInfo))

ValidPathInfo or exception

validPathInfoNarSize :: ForeignPtr (Ref ValidPathInfo) -> Int64 Source #

The narSize field of a ValidPathInfo struct. Source: path-info.hh / store-api.hh

validPathInfoNarHash32 :: ForeignPtr (Ref ValidPathInfo) -> IO ByteString Source #

Copy the narHash field of a ValidPathInfo struct. Source: path-info.hh / store-api.hh

validPathInfoDeriver :: Store -> ForeignPtr (Ref ValidPathInfo) -> IO (Maybe StorePath) Source #

Deriver field of a ValidPathInfo struct. Source: store-api.hh

validPathInfoReferences :: Store -> ForeignPtr (Ref ValidPathInfo) -> IO [StorePath] Source #

References field of a ValidPathInfo struct. Source: store-api.hh

withPtr' :: Coercible a' (ForeignPtr a) => a' -> (Ptr a -> IO b) -> IO b Source #

data Strings Source #

A Nix Strings aka std::liststd::string

data Ref a Source #

A Nix ref, to be used in phantom types.