| Copyright | Profpatsch 2018 |
|---|---|
| License | GPL-3 |
| Stability | experimental |
| Portability | nix-prefetch-scripts 2018 (no version number) |
| Safe Haskell | None |
| Language | Haskell2010 |
Foreign.Nix.Shellout.Prefetch
Description
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 (Text, e) a)
- newtype NixAction e a = NixAction {
- unNixAction :: ExceptT (Text, e) IO a
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 #
Constructors
| GitOptions | |
Fields
| |
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.
Constructors
| GitOutput | |
Fields
| |
Types
data PrefetchError Source #
Constructors
| 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 Methods (==) :: PrefetchError -> PrefetchError -> Bool # (/=) :: PrefetchError -> PrefetchError -> Bool # | |
| Show PrefetchError Source # | |
Defined in Foreign.Nix.Shellout.Prefetch Methods showsPrec :: Int -> PrefetchError -> ShowS # show :: PrefetchError -> String # showList :: [PrefetchError] -> ShowS # | |
A descriptive type for URLs.
A sha-256 hash.
Reexports
newtype NixAction e a Source #
Calls a command that returns an error and the whole stderr on failure.
Constructors
| NixAction | |
Fields
| |