-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Bindings to the nix package manager
--
-- Use the nix package manager from Haskell. All modules are designed to
-- be imported qualified.
@package libnix
@version 0.2.0.1
module Foreign.Nix.Shellout.Types
-- | Calls a command that returns an error and the whole stderr on failure.
newtype NixAction e a
NixAction :: ExceptT (Text, e) IO a -> NixAction e a
[unNixAction] :: NixAction e a -> ExceptT (Text, e) IO a
-- | Run a NixAction without having to go through ExceptT
-- first.
runNixAction :: NixAction e a -> IO (Either (Text, e) a)
-- | A path in the nix store. It carries a phantom a to
-- differentiate between Derivation files and Realized
-- paths.
newtype StorePath a
StorePath :: FilePath -> StorePath a
[fromStorePath] :: StorePath a -> FilePath
-- | A nix derivation is a complete build instruction that can be realized.
data Derivation
-- | Once a derivation is realized, the finished output can be used.
data Realized
instance GHC.Show.Show (Foreign.Nix.Shellout.Types.StorePath a)
instance GHC.Classes.Eq (Foreign.Nix.Shellout.Types.StorePath a)
instance Control.Monad.IO.Class.MonadIO (Foreign.Nix.Shellout.Types.NixAction e)
instance GHC.Base.Monad (Foreign.Nix.Shellout.Types.NixAction e)
instance GHC.Base.Applicative (Foreign.Nix.Shellout.Types.NixAction e)
instance GHC.Base.Functor (Foreign.Nix.Shellout.Types.NixAction e)
instance Data.Bifunctor.Bifunctor Foreign.Nix.Shellout.Types.NixAction
-- | Calls to the nix-prefetch-X utilities, to parse their output
-- into nice reusable data types.
module Foreign.Nix.Shellout.Prefetch
-- | Runs nix-prefetch-url.
url :: UrlOptions -> NixAction PrefetchError (Sha256, StorePath Realized)
data UrlOptions
UrlOptions :: Url -> Bool -> Maybe Text -> Maybe Sha256 -> UrlOptions
-- | the URL
[urlUrl] :: UrlOptions -> Url
-- | whether to unpack before hashing (useful for prefetching
-- fetchTarball)
[urlUnpack] :: UrlOptions -> Bool
-- | name of the store path
[urlName] :: UrlOptions -> Maybe Text
-- | the hash we are expecting
[urlExpectedHash] :: UrlOptions -> Maybe Sha256
-- | Takes the URL, doesn’t unpack and uses the default name.
defaultUrlOptions :: Url -> UrlOptions
-- | Runs nix-prefetch-git.
git :: GitOptions -> NixAction PrefetchError GitOutput
data GitOptions
GitOptions :: Url -> Maybe Text -> Maybe Sha256 -> Bool -> Bool -> Bool -> GitOptions
-- | the URL
[gitUrl] :: GitOptions -> Url
-- | a git revision (hash, branch name, tag, ref, …)
[gitRev] :: GitOptions -> Maybe Text
-- | the hash we are expecting
[gitExpectedHash] :: GitOptions -> Maybe Sha256
-- | whether to do a deep instead of a shallow (--depth=1) git
-- clone
[gitDeepClone] :: GitOptions -> Bool
-- | whether to keep .git directories
[gitLeaveDotGit] :: GitOptions -> Bool
-- | whether to fetch submodules
[gitFetchSubmodules] :: GitOptions -> Bool
-- | Takes the url, mirrors the default fetchgit options in
-- nixpkgs: no deep clone, no .git, fetches submodules by
-- default. By default, the latest default rev is used.
defaultGitOptions :: Url -> GitOptions
data GitOutput
GitOutput :: Text -> Sha256 -> StorePath Realized -> GitOutput
-- | The actual revision that is used (useful if no gitRev was
-- given)
[gitOutputRev] :: GitOutput -> Text
-- | the hash
[gitOutputSha256] :: GitOutput -> Sha256
-- | the store path of the result
[gitOuputPath] :: GitOutput -> StorePath Realized
data PrefetchError
-- | the tool’s output could not be parsed as expected
PrefetchOutputMalformed :: Text -> PrefetchError
-- | an expected hash was given and not valid
ExpectedHashError :: PrefetchError
-- | catch-all error
UnknownPrefetchError :: PrefetchError
-- | A descriptive type for URLs.
newtype Url
Url :: Text -> Url
[unUrl] :: Url -> Text
-- | A sha-256 hash.
newtype Sha256
Sha256 :: Text -> Sha256
[unSha256] :: Sha256 -> Text
-- | Run a NixAction without having to go through ExceptT
-- first.
runNixAction :: NixAction e a -> IO (Either (Text, e) a)
-- | Calls a command that returns an error and the whole stderr on failure.
newtype NixAction e a
NixAction :: ExceptT (Text, e) IO a -> NixAction e a
[unNixAction] :: NixAction e a -> ExceptT (Text, e) IO a
instance GHC.Classes.Eq Foreign.Nix.Shellout.Prefetch.GitOutput
instance GHC.Show.Show Foreign.Nix.Shellout.Prefetch.GitOutput
instance Data.String.IsString Foreign.Nix.Shellout.Prefetch.Sha256
instance GHC.Classes.Eq Foreign.Nix.Shellout.Prefetch.Sha256
instance GHC.Show.Show Foreign.Nix.Shellout.Prefetch.Sha256
instance Data.String.IsString Foreign.Nix.Shellout.Prefetch.Url
instance GHC.Classes.Eq Foreign.Nix.Shellout.Prefetch.Url
instance GHC.Show.Show Foreign.Nix.Shellout.Prefetch.Url
instance GHC.Show.Show Foreign.Nix.Shellout.Prefetch.PrefetchError
instance GHC.Classes.Eq Foreign.Nix.Shellout.Prefetch.PrefetchError
-- | Calls to the nix command line to convert textual nix expressions to
-- derivations & realized storepaths.
module Foreign.Nix.Shellout
-- | Parse a nix expression and check for syntactic validity.
parseNixExpr :: Text -> NixAction ParseError NixExpr
data ParseError
-- | the input string was not a syntactically valid nix expression
SyntaxError :: Text -> ParseError
-- | catch-all error
UnknownParseError :: ParseError
-- | Instantiate a parsed expression into a derivation.
instantiate :: NixExpr -> NixAction InstantiateError (StorePath Derivation)
data InstantiateError
-- | the given expression does not evaluate to a derivaton
NotADerivation :: InstantiateError
-- | catch-all error
UnknownInstantiateError :: InstantiateError
-- | Just tests if the expression can be evaluated. That doesn’t mean it
-- has to instantiate however.
eval :: NixExpr -> NixAction InstantiateError ()
-- | Finally derivations are realized into full store outputs. This will
-- typically take a while so it should be executed asynchronously.
realize :: StorePath Derivation -> NixAction RealizeError (StorePath Realized)
data RealizeError
UnknownRealizeError :: RealizeError
-- | Copy the given file or folder to the nix store and return it’s path.
addToStore :: FilePath -> NixAction RealizeError (StorePath Realized)
-- | A convenience function to directly realize a nix expression. Any
-- errors are put into a combined error type.
parseInstRealize :: Text -> NixAction NixError (StorePath Realized)
-- | Combines all error types that could happen.
data NixError
ParseError :: ParseError -> NixError
InstantiateError :: InstantiateError -> NixError
RealizeError :: RealizeError -> NixError
-- | A path in the nix store. It carries a phantom a to
-- differentiate between Derivation files and Realized
-- paths.
data StorePath a
-- | A nix derivation is a complete build instruction that can be realized.
data Derivation
-- | Once a derivation is realized, the finished output can be used.
data Realized
-- | A sucessfully parsed nix expression.
data NixExpr
-- | Run a NixAction without having to go through ExceptT
-- first.
runNixAction :: NixAction e a -> IO (Either (Text, e) a)
-- | Calls a command that returns an error and the whole stderr on failure.
newtype NixAction e a
NixAction :: ExceptT (Text, e) IO a -> NixAction e a
[unNixAction] :: NixAction e a -> ExceptT (Text, e) IO a
instance GHC.Classes.Eq Foreign.Nix.Shellout.NixError
instance GHC.Show.Show Foreign.Nix.Shellout.NixError
instance GHC.Classes.Eq Foreign.Nix.Shellout.RealizeError
instance GHC.Show.Show Foreign.Nix.Shellout.RealizeError
instance GHC.Classes.Eq Foreign.Nix.Shellout.InstantiateError
instance GHC.Show.Show Foreign.Nix.Shellout.InstantiateError
instance GHC.Classes.Eq Foreign.Nix.Shellout.ParseError
instance GHC.Show.Show Foreign.Nix.Shellout.ParseError
instance GHC.Classes.Eq Foreign.Nix.Shellout.NixExpr
instance GHC.Show.Show Foreign.Nix.Shellout.NixExpr