Copyright | Profpatsch 2018–2021 |
---|---|
License | GPL-3 |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newtype StorePath a = StorePath {}
- data Derivation
- data Realized
- runNixAction :: RunOptions m -> NixAction e m a -> m (Either (NixActionError e) a)
- newtype NixAction e m a = NixAction {
- unNixAction :: ReaderT (RunOptions m) (ExceptT (NixActionError e) m) a
- data RunOptions m = RunOptions {
- logFn :: LogFn m
- executables :: Executables
- defaultRunOptions :: Monad m => RunOptions m
- newtype LogFn m = LogFn (Text -> [Text] -> m ())
- data Executables = Executables {}
- defaultExecutables :: Executables
- data NixActionError e = NixActionError {
- actionStderr :: Text
- actionError :: e
- mapActionError :: Functor m => (a1 -> e) -> NixAction a1 m a2 -> NixAction e m a2
Store paths
A path in the nix store. It carries a phantom a
to differentiate
between Derivation
files and Realized
paths.
data Derivation Source #
A nix derivation is a complete build instruction that can be realized.
NixAction
runNixAction :: RunOptions m -> NixAction e m a -> m (Either (NixActionError e) a) Source #
Run a NixAction
, given runtime options. See defaultRunOptions
.
newtype NixAction e m a Source #
Calls a command that returns an error and the whole stderr on failure.
NixAction | |
|
Instances
data RunOptions m Source #
Options that modify how a NixAction
executes.
Might get more fields in the future, use defaultRunOptions
to be backwards-compatbile.
RunOptions | |
|
Instances
Monad m => MonadReader (RunOptions m) (NixAction e m) Source # | |
Defined in Foreign.Nix.Shellout.Types ask :: NixAction e m (RunOptions m) # local :: (RunOptions m -> RunOptions m) -> NixAction e m a -> NixAction e m a # reader :: (RunOptions m -> a) -> NixAction e m a # |
defaultRunOptions :: Monad m => RunOptions m Source #
logFn = nothing is done/logged
executable = all executables are taken from PATH
Logging function to call before running a command. This can be used to provide debugging output.
The first argument is the executable name, the second argument is the list of arguments.
data Executables Source #
All executables this library might need.
If you set an executable to Just filepath
, the internal code will use the given path instead of looking up the executable name in PATH
.
This is useful if you want to ensure that the executables always exist before calling into this library.
NixAction
functions document the executables they use in their docstrings.
If an executable can’t be found, an IOException
is thrown (by the process spawn function).
Executables | |
|
defaultExecutables :: Executables Source #
all executables are taken from PATH
data NixActionError e Source #
Combines the standard error of running a command with a more semantic error type one should match on first.
NixActionError | |
|
Instances
Functor NixActionError Source # | |
Defined in Foreign.Nix.Shellout.Types fmap :: (a -> b) -> NixActionError a -> NixActionError b # (<$) :: a -> NixActionError b -> NixActionError a # | |
Show e => Show (NixActionError e) Source # | |
Defined in Foreign.Nix.Shellout.Types showsPrec :: Int -> NixActionError e -> ShowS # show :: NixActionError e -> String # showList :: [NixActionError e] -> ShowS # | |
Monad m => MonadError (NixActionError e) (NixAction e m) Source # | |
Defined in Foreign.Nix.Shellout.Types throwError :: NixActionError e -> NixAction e m a # catchError :: NixAction e m a -> (NixActionError e -> NixAction e m a) -> NixAction e m a # |
mapActionError :: Functor m => (a1 -> e) -> NixAction a1 m a2 -> NixAction e m a2 Source #
Map over the e
in a NixActionError
.