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

Hercules.CNix.Store

Synopsis

Documentation

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 Store Source #

Constructors

Store (Ptr (Ref NixStore)) 

newtype StorePath Source #

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

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

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 

getDerivationInputs' :: Derivation -> IO [(StorePath, [ByteString])] Source #

Get the inputs of a derivation, ignoring dependencies on outputs of outputs (RFC 92 inputs).

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

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

Query only the local client cache ("narinfo cache") - does not query the actual store or daemon.

Returns Nothing if nothing is known about the path. Returns 'Just Nothing' if the path is known to not exist. Returns 'Just (Just vpi)' if the path is known to exist, with the given ValidPathInfo.

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 Ref a Source #

A Nix ref, to be used in phantom types.

data Strings Source #

A Nix Strings aka std::liststd::string