Copyright | Profpatsch 2018 |
---|---|
License | GPL-3 |
Stability | experimental |
Portability | nix-prefetch-scripts 2018 (no version number) |
Safe Haskell | None |
Language | Haskell2010 |
Calls to the nix-prefetch-X
utilities, to parse their output
into nice reusable data types.
Synopsis
- url :: UrlOptions -> NixAction PrefetchError (Sha256, StorePath Realized)
- data UrlOptions = UrlOptions {}
- defaultUrlOptions :: Url -> UrlOptions
- git :: GitOptions -> NixAction PrefetchError GitOutput
- data GitOptions = GitOptions {}
- defaultGitOptions :: Url -> GitOptions
- data GitOutput = GitOutput {}
- data PrefetchError
- newtype Url = Url {}
- newtype Sha256 = Sha256 {}
- runNixAction :: NixAction e a -> IO (Either (NixActionError e) a)
- newtype NixAction e a = NixAction {
- unNixAction :: ExceptT (NixActionError e) IO a
- data NixActionError e = NixActionError {
- actionStderr :: Text
- actionError :: e
nix-prefetch-url
url :: UrlOptions -> NixAction PrefetchError (Sha256, StorePath Realized) Source #
Runs nix-prefetch-url
.
data UrlOptions Source #
defaultUrlOptions :: Url -> UrlOptions Source #
Takes the URL, doesn’t unpack and uses the default name.
nix-prefetch-git
git :: GitOptions -> NixAction PrefetchError GitOutput Source #
Runs nix-prefetch-git
.
data GitOptions Source #
GitOptions | |
|
defaultGitOptions :: Url -> GitOptions Source #
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.
GitOutput | |
|
Types
data PrefetchError Source #
PrefetchOutputMalformed Text | the tool’s output could not be parsed as expected |
ExpectedHashError | an expected hash was given and not valid |
UnknownPrefetchError | catch-all error |
Instances
Eq PrefetchError Source # | |
Defined in Foreign.Nix.Shellout.Prefetch (==) :: PrefetchError -> PrefetchError -> Bool # (/=) :: PrefetchError -> PrefetchError -> Bool # | |
Show PrefetchError Source # | |
Defined in Foreign.Nix.Shellout.Prefetch showsPrec :: Int -> PrefetchError -> ShowS # show :: PrefetchError -> String # showList :: [PrefetchError] -> ShowS # |
A descriptive type for URLs.
A sha-256
hash.
Reexports
runNixAction :: NixAction e a -> IO (Either (NixActionError e) a) Source #
newtype NixAction e a Source #
Calls a command that returns an error and the whole stderr on failure.
NixAction | |
|
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 # |