| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hercules.CNix.Expr
Contents
Synopsis
- init :: IO ()
- setTalkative :: IO ()
- setDebug :: IO ()
- setGlobalOption :: Text -> Text -> IO ()
- setOption :: Text -> Text -> IO ()
- setExtraStackOverflowHandlerToSleep :: IO ()
- initThread :: IO ()
- allowThreads :: IO ()
- runGcRegisteredThread :: IO a -> IO a
- logInfo :: Text -> IO ()
- withEvalState :: Store -> (Ptr EvalState -> IO a) -> IO a
- withEvalStateConduit :: forall (m :: Type -> Type) i o r. MonadResource m => Store -> (Ptr EvalState -> ConduitT i o m r) -> ConduitT i o m r
- addAllowedPath :: Ptr EvalState -> ByteString -> IO ()
- addInternalAllowedPaths :: Ptr EvalState -> IO ()
- evalFile :: Ptr EvalState -> FilePath -> IO RawValue
- newStrings :: IO (Ptr Strings)
- appendString :: Ptr Strings -> ByteString -> IO ()
- autoCallFunction :: Ptr EvalState -> RawValue -> Value NixAttrs -> IO RawValue
- isDerivation :: Ptr EvalState -> RawValue -> IO Bool
- isFunctor :: Ptr EvalState -> RawValue -> IO Bool
- getRecurseForDerivations :: Ptr EvalState -> Value NixAttrs -> IO Bool
- getAttr :: Ptr EvalState -> Value NixAttrs -> ByteString -> IO (Maybe RawValue)
- mkNullableRawValue :: Ptr Value' -> IO (Maybe RawValue)
- getAttrs :: Ptr EvalState -> Value NixAttrs -> IO (Map ByteString RawValue)
- getDrvFile :: MonadIO m => Ptr EvalState -> RawValue -> m StorePath
- getAttrBool :: Ptr EvalState -> Value NixAttrs -> ByteString -> IO (Either SomeException (Maybe Bool))
- getList :: Value NixList -> IO [RawValue]
- getAttrList :: Ptr EvalState -> Value NixAttrs -> ByteString -> IO (Either SomeException (Maybe [RawValue]))
- valueFromExpressionString :: Ptr EvalState -> ByteString -> ByteString -> IO RawValue
- callFunction :: Ptr EvalState -> RawValue -> RawValue -> IO RawValue
- apply :: RawValue -> RawValue -> IO RawValue
- mkPath :: Ptr EvalState -> ByteString -> IO (Value NixPath)
- getFlakeFromFlakeRef :: Ptr EvalState -> ByteString -> IO RawValue
- getLocalFlake :: Ptr EvalState -> Text -> IO RawValue
- getFlakeFromGit :: Ptr EvalState -> Text -> Text -> Text -> IO RawValue
- getFlakeFromArchiveUrl :: Ptr EvalState -> Text -> IO RawValue
- class ToRawValue a where
- toRawValue :: Ptr EvalState -> a -> IO RawValue
- class ToRawValue a => ToValue a where
- type NixTypeFor a
- toValue :: Ptr EvalState -> a -> IO (Value (NixTypeFor a))
- class FromValue n a | a -> n where
- newtype ViaJSON a = ViaJSON {
- fromViaJSON :: a
- data RawValue
- rawValueType :: RawValue -> IO RawValueType
- newtype Store = Store (Ptr (Ref NixStore))
- context :: Context
- data FileIngestionMethod
- data Hash = Hash !HashType !ShortByteString
- unsafeMallocBS :: MonadIO m => IO CString -> m ByteString
- newtype Derivation = Derivation (ForeignPtr Derivation)
- data DerivationInputsIterator
- data DerivationOutputsIterator
- data NixStore
- data NixStorePath
- data Ref a
- data SecretKey
- data StringPairs
- data Strings
- data ValidPathInfo
- newtype StorePath = StorePath (ForeignPtr NixStorePath)
- forNonNull :: Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
- traverseNonNull :: (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
- withPtr' :: Coercible a' (ForeignPtr a) => a' -> (Ptr a -> IO b) -> IO b
- finalizeRefValidPathInfo :: FinalizerPtr (Ref ValidPathInfo)
- finalizeSecretKey :: FinalizerPtr SecretKey
- finalizeStrings :: FinalizerPtr Strings
- deleteStrings :: Ptr Strings -> IO ()
- deleteStringPairs :: Ptr StringPairs -> IO ()
- deleteDerivationInputsIterator :: Ptr DerivationInputsIterator -> IO ()
- deleteDerivationOutputsIterator :: Ptr DerivationOutputsIterator -> IO ()
- finalizeDerivation :: FinalizerPtr Derivation
- finalizeStorePathWithOutputs :: FinalizerPtr NixStorePathWithOutputs
- moveStorePathMaybe :: Ptr NixStorePath -> IO (Maybe StorePath)
- moveStorePath :: Ptr NixStorePath -> IO StorePath
- finalizeStorePath :: FinalizerPtr NixStorePath
- data DerivationOutput = DerivationOutput {}
- data DerivationOutputDetail
- data FixedOutputHash = FixedOutputHash !FileIngestionMethod !Hash
- data HashType
- newtype StorePathWithOutputs = StorePathWithOutputs (ForeignPtr NixStorePathWithOutputs)
- addTemporaryRoot :: Store -> StorePath -> IO ()
- buildPath :: Store -> StorePathWithOutputs -> IO ()
- buildPaths :: Store -> StdVector NixStorePathWithOutputs -> IO ()
- clearPathInfoCache :: Store -> IO ()
- clearSubstituterCaches :: IO ()
- computeFSClosure :: Store -> ClosureParams -> StdSet NixStorePath -> IO (StdSet NixStorePath)
- copyClosure :: Store -> Store -> [StorePath] -> IO ()
- defaultClosureParams :: ClosureParams
- ensurePath :: Store -> StorePath -> IO ()
- followLinksToStorePath :: Store -> ByteString -> IO StorePath
- getClientProtocolVersion :: IO Int
- getDerivation :: Store -> StorePath -> IO Derivation
- getDerivationArguments :: Derivation -> IO [ByteString]
- getDerivationBuilder :: Derivation -> IO ByteString
- getDerivationEnv :: Derivation -> IO (Map ByteString ByteString)
- getDerivationFromString :: Store -> ByteString -> ByteString -> IO Derivation
- getDerivationInputs :: Store -> Derivation -> IO [(StorePath, [ByteString])]
- getDerivationInputs' :: Derivation -> IO [(StorePath, [ByteString])]
- getDerivationNameFromPath :: StorePath -> IO ByteString
- getDerivationOutputNames :: ForeignPtr Derivation -> IO [ByteString]
- getDerivationOutputs :: Store -> ByteString -> Derivation -> IO [DerivationOutput]
- getDerivationPlatform :: Derivation -> IO ByteString
- getDerivationSources :: Store -> Derivation -> IO [StorePath]
- getDerivationSources' :: Derivation -> IO [StorePath]
- getOutputs :: StorePathWithOutputs -> IO [ByteString]
- getStorePath :: StorePathWithOutputs -> IO StorePath
- getStorePathBaseName :: StorePath -> IO ByteString
- getStorePathHash :: StorePath -> IO ByteString
- getStoreProtocolVersion :: Store -> IO Int
- getStringsLength :: Ptr Strings -> IO CSize
- isValidPath :: Store -> StorePath -> IO Bool
- newStorePathWithOutputs :: StorePath -> [ByteString] -> IO StorePathWithOutputs
- openStore :: IO Store
- parseSecretKey :: ByteString -> IO (ForeignPtr SecretKey)
- parseStorePath :: Store -> ByteString -> IO StorePath
- parseStorePathBaseName :: ByteString -> IO StorePath
- pushString :: Ptr Strings -> ByteString -> IO ()
- queryPathInfo :: Store -> StorePath -> IO (ForeignPtr (Ref ValidPathInfo))
- queryPathInfoFromClientCache :: Store -> StorePath -> IO (Maybe (Maybe (ForeignPtr (Ref ValidPathInfo))))
- releaseStore :: Store -> IO ()
- signPath :: Store -> Ptr SecretKey -> StorePath -> IO Bool
- storeDir :: MonadIO m => Store -> m ByteString
- storePathToPath :: Store -> StorePath -> IO ByteString
- storeUri :: MonadIO m => Store -> m ByteString
- toByteStringMap :: Ptr StringPairs -> IO (Map ByteString ByteString)
- toByteStrings :: Ptr Strings -> IO [ByteString]
- validPathInfoDeriver :: Store -> ForeignPtr (Ref ValidPathInfo) -> IO (Maybe StorePath)
- validPathInfoDeriver' :: ForeignPtr (Ref ValidPathInfo) -> IO (Maybe StorePath)
- validPathInfoNarHash32 :: ForeignPtr (Ref ValidPathInfo) -> IO ByteString
- validPathInfoNarSize :: ForeignPtr (Ref ValidPathInfo) -> Int64
- validPathInfoReferences :: Store -> ForeignPtr (Ref ValidPathInfo) -> IO [StorePath]
- validPathInfoReferences' :: ForeignPtr (Ref ValidPathInfo) -> IO [StorePath]
- withStore :: MonadUnliftIO m => (Store -> m a) -> m a
- withStore' :: (Store -> IO r) -> IO r
- withStoreFromURI :: MonadUnliftIO m => Text -> (Store -> m r) -> m r
- withStrings :: (Ptr Strings -> IO a) -> IO a
- withStringsOf :: [ByteString] -> (Ptr Strings -> IO a) -> IO a
- data ClosureParams = ClosureParams {}
- module Hercules.CNix.Expr.Typed
- data EvalState
Documentation
setTalkative :: IO () Source #
setExtraStackOverflowHandlerToSleep :: IO () Source #
Configure the stack overflow handler to sleep before returning, allowing other threads to continue for a bit.
No-op before Nix 2.12
initThread :: IO () Source #
Initialize the current (main) thread for stack overflow detection.
allowThreads :: IO () Source #
Configure the garbage collector to support threads.
This is not needed when all evaluation happens on the main thread.
runGcRegisteredThread :: IO a -> IO a Source #
Run in a thread from which GC may be triggered safely.
This also installs the stack overflow handler.
NOTE: Before using this, you must call allowThreads once.
withEvalStateConduit :: forall (m :: Type -> Type) i o r. MonadResource m => Store -> (Ptr EvalState -> ConduitT i o m r) -> ConduitT i o m r Source #
addAllowedPath :: Ptr EvalState -> ByteString -> IO () Source #
Insert an allowed path. Only has an effect when in restricted or pure mode.
appendString :: Ptr Strings -> ByteString -> IO () Source #
getAttrBool :: Ptr EvalState -> Value NixAttrs -> ByteString -> IO (Either SomeException (Maybe Bool)) Source #
getAttrList :: Ptr EvalState -> Value NixAttrs -> ByteString -> IO (Either SomeException (Maybe [RawValue])) Source #
valueFromExpressionString Source #
Arguments
| :: Ptr EvalState | |
| -> ByteString | The string to parse |
| -> ByteString | Base path for path exprs |
| -> IO RawValue |
Parse a string and eval it.
getFlakeFromFlakeRef :: Ptr EvalState -> ByteString -> IO RawValue Source #
class ToRawValue a where Source #
Minimal complete definition
Nothing
Methods
Instances
class ToRawValue a => ToValue a where Source #
Associated Types
type NixTypeFor a Source #
Instances
class FromValue n a | a -> n where Source #
Marshall values from Nix into Haskell. Instances must satisfy the requirements that:
- Only a single Nix value type is acceptable for the Haskell type.
- Marshalling does not fail, as the Nix runtime type has already been checked.
For deriving-via of ToRawValue using ToJSON.
Constructors
| ViaJSON | |
Fields
| |
Instances
| Read a => Read (ViaJSON a) Source # | |
| Show a => Show (ViaJSON a) Source # | |
| Eq a => Eq (ViaJSON a) Source # | |
| Ord a => Ord (ViaJSON a) Source # | |
| ToJSON a => ToRawValue (ViaJSON a) Source # | |
Defined in Hercules.CNix.Expr | |
Re-exports
A heap object.
Nix doesn't store all its objects on the heap, but we do.
Also, Nix calls them Values but it includes thunks, which are not values
and some may never produce values, such as throw "msg".
rawValueType :: RawValue -> IO RawValueType Source #
You may need to forceValue first.
data FileIngestionMethod #
Instances
| Show FileIngestionMethod | |
Defined in Hercules.CNix.Store Methods showsPrec :: Int -> FileIngestionMethod -> ShowS # show :: FileIngestionMethod -> String # showList :: [FileIngestionMethod] -> ShowS # | |
| Eq FileIngestionMethod | |
Defined in Hercules.CNix.Store Methods (==) :: FileIngestionMethod -> FileIngestionMethod -> Bool # (/=) :: FileIngestionMethod -> FileIngestionMethod -> Bool # | |
Constructors
| Hash !HashType !ShortByteString |
unsafeMallocBS :: MonadIO m => IO CString -> m ByteString #
newtype Derivation #
Constructors
| Derivation (ForeignPtr Derivation) |
Instances
| HasEncapsulation Derivation Derivation | |
Defined in Hercules.CNix.Store Methods | |
data NixStorePath #
Instances
| HasEncapsulation NixStorePath StorePath | |
Defined in Hercules.CNix.Store Methods | |
data StringPairs #
data ValidPathInfo #
Constructors
| StorePath (ForeignPtr NixStorePath) |
Instances
| Show StorePath | |
| Eq StorePath | |
| Ord StorePath | |
| HasEncapsulation NixStorePath StorePath | |
Defined in Hercules.CNix.Store Methods | |
deleteStrings :: Ptr Strings -> IO () #
deleteStringPairs :: Ptr StringPairs -> IO () #
moveStorePathMaybe :: Ptr NixStorePath -> IO (Maybe StorePath) #
moveStorePath :: Ptr NixStorePath -> IO StorePath #
data DerivationOutput #
Constructors
| DerivationOutput | |
Instances
| Show DerivationOutput | |
Defined in Hercules.CNix.Store Methods showsPrec :: Int -> DerivationOutput -> ShowS # show :: DerivationOutput -> String # showList :: [DerivationOutput] -> ShowS # | |
| Eq DerivationOutput | |
Defined in Hercules.CNix.Store Methods (==) :: DerivationOutput -> DerivationOutput -> Bool # (/=) :: DerivationOutput -> DerivationOutput -> Bool # | |
data DerivationOutputDetail #
Constructors
| DerivationOutputInputAddressed StorePath | |
| DerivationOutputCAFixed FixedOutputHash StorePath | |
| DerivationOutputCAFloating FileIngestionMethod HashType | |
| DerivationOutputDeferred |
Instances
| Show DerivationOutputDetail | |
Defined in Hercules.CNix.Store Methods showsPrec :: Int -> DerivationOutputDetail -> ShowS # show :: DerivationOutputDetail -> String # showList :: [DerivationOutputDetail] -> ShowS # | |
| Eq DerivationOutputDetail | |
Defined in Hercules.CNix.Store Methods (==) :: DerivationOutputDetail -> DerivationOutputDetail -> Bool # (/=) :: DerivationOutputDetail -> DerivationOutputDetail -> Bool # | |
data FixedOutputHash #
Constructors
| FixedOutputHash !FileIngestionMethod !Hash |
Instances
| Show FixedOutputHash | |
Defined in Hercules.CNix.Store Methods showsPrec :: Int -> FixedOutputHash -> ShowS # show :: FixedOutputHash -> String # showList :: [FixedOutputHash] -> ShowS # | |
| Eq FixedOutputHash | |
Defined in Hercules.CNix.Store Methods (==) :: FixedOutputHash -> FixedOutputHash -> Bool # (/=) :: FixedOutputHash -> FixedOutputHash -> Bool # | |
newtype StorePathWithOutputs #
Constructors
| StorePathWithOutputs (ForeignPtr NixStorePathWithOutputs) |
Instances
| HasEncapsulation NixStorePathWithOutputs StorePathWithOutputs | |
Defined in Hercules.CNix.Store | |
addTemporaryRoot :: Store -> StorePath -> IO () #
buildPath :: Store -> StorePathWithOutputs -> IO () #
buildPaths :: Store -> StdVector NixStorePathWithOutputs -> IO () #
clearPathInfoCache :: Store -> IO () #
clearSubstituterCaches :: IO () #
computeFSClosure :: Store -> ClosureParams -> StdSet NixStorePath -> IO (StdSet NixStorePath) #
ensurePath :: Store -> StorePath -> IO () #
followLinksToStorePath :: Store -> ByteString -> IO StorePath #
getDerivation :: Store -> StorePath -> IO Derivation #
getDerivationArguments :: Derivation -> IO [ByteString] #
getDerivationEnv :: Derivation -> IO (Map ByteString ByteString) #
getDerivationFromString :: Store -> ByteString -> ByteString -> IO Derivation #
getDerivationInputs :: Store -> Derivation -> IO [(StorePath, [ByteString])] #
getDerivationInputs' :: Derivation -> IO [(StorePath, [ByteString])] #
getDerivationOutputs :: Store -> ByteString -> Derivation -> IO [DerivationOutput] #
getDerivationSources :: Store -> Derivation -> IO [StorePath] #
getDerivationSources' :: Derivation -> IO [StorePath] #
getOutputs :: StorePathWithOutputs -> IO [ByteString] #
getStorePathHash :: StorePath -> IO ByteString #
getStoreProtocolVersion :: Store -> IO Int #
parseSecretKey :: ByteString -> IO (ForeignPtr SecretKey) #
parseStorePath :: Store -> ByteString -> IO StorePath #
pushString :: Ptr Strings -> ByteString -> IO () #
queryPathInfo :: Store -> StorePath -> IO (ForeignPtr (Ref ValidPathInfo)) #
queryPathInfoFromClientCache :: Store -> StorePath -> IO (Maybe (Maybe (ForeignPtr (Ref ValidPathInfo)))) #
releaseStore :: Store -> IO () #
storeDir :: MonadIO m => Store -> m ByteString #
storePathToPath :: Store -> StorePath -> IO ByteString #
storeUri :: MonadIO m => Store -> m ByteString #
toByteStringMap :: Ptr StringPairs -> IO (Map ByteString ByteString) #
toByteStrings :: Ptr Strings -> IO [ByteString] #
validPathInfoDeriver :: Store -> ForeignPtr (Ref ValidPathInfo) -> IO (Maybe StorePath) #
validPathInfoDeriver' :: ForeignPtr (Ref ValidPathInfo) -> IO (Maybe StorePath) #
validPathInfoNarSize :: ForeignPtr (Ref ValidPathInfo) -> Int64 #
validPathInfoReferences :: Store -> ForeignPtr (Ref ValidPathInfo) -> IO [StorePath] #
validPathInfoReferences' :: ForeignPtr (Ref ValidPathInfo) -> IO [StorePath] #
withStore :: MonadUnliftIO m => (Store -> m a) -> m a #
withStore' :: (Store -> IO r) -> IO r #
withStoreFromURI :: MonadUnliftIO m => Text -> (Store -> m r) -> m r #
withStringsOf :: [ByteString] -> (Ptr Strings -> IO a) -> IO a #
data ClosureParams #
Constructors
| ClosureParams | |
Fields
| |
module Hercules.CNix.Expr.Typed