libnix-0.2.0.1: Bindings to the nix package manager

CopyrightProfpatsch 2018
LicenseGPL-3
Stabilityexperimental
Portabilitynix-prefetch-scripts 2018 (no version number)
Safe HaskellNone
LanguageHaskell2010

Foreign.Nix.Shellout.Prefetch

Contents

Description

Calls to the nix-prefetch-X utilities, to parse their output into nice reusable data types.

Synopsis

nix-prefetch-url

data UrlOptions Source #

Constructors

UrlOptions 

Fields

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.

data GitOutput Source #

Constructors

GitOutput 

Fields

Instances
Eq GitOutput Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

Show GitOutput Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

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

newtype Url Source #

A descriptive type for URLs.

Constructors

Url 

Fields

Instances
Eq Url Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

Methods

(==) :: Url -> Url -> Bool #

(/=) :: Url -> Url -> Bool #

Show Url Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

Methods

showsPrec :: Int -> Url -> ShowS #

show :: Url -> String #

showList :: [Url] -> ShowS #

IsString Url Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

Methods

fromString :: String -> Url #

newtype Sha256 Source #

A sha-256 hash.

Constructors

Sha256 

Fields

Instances
Eq Sha256 Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

Methods

(==) :: Sha256 -> Sha256 -> Bool #

(/=) :: Sha256 -> Sha256 -> Bool #

Show Sha256 Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

IsString Sha256 Source # 
Instance details

Defined in Foreign.Nix.Shellout.Prefetch

Methods

fromString :: String -> Sha256 #

Reexports

runNixAction :: NixAction e a -> IO (Either (Text, e) a) Source #

Run a NixAction without having to go through ExceptT first.

newtype NixAction e a Source #

Calls a command that returns an error and the whole stderr on failure.

Constructors

NixAction 

Fields

Instances
Bifunctor NixAction Source # 
Instance details

Defined in Foreign.Nix.Shellout.Types

Methods

bimap :: (a -> b) -> (c -> d) -> NixAction a c -> NixAction b d #

first :: (a -> b) -> NixAction a c -> NixAction b c #

second :: (b -> c) -> NixAction a b -> NixAction a c #

Monad (NixAction e) Source # 
Instance details

Defined in Foreign.Nix.Shellout.Types

Methods

(>>=) :: NixAction e a -> (a -> NixAction e b) -> NixAction e b #

(>>) :: NixAction e a -> NixAction e b -> NixAction e b #

return :: a -> NixAction e a #

fail :: String -> NixAction e a #

Functor (NixAction e) Source # 
Instance details

Defined in Foreign.Nix.Shellout.Types

Methods

fmap :: (a -> b) -> NixAction e a -> NixAction e b #

(<$) :: a -> NixAction e b -> NixAction e a #

Applicative (NixAction e) Source # 
Instance details

Defined in Foreign.Nix.Shellout.Types

Methods

pure :: a -> NixAction e a #

(<*>) :: NixAction e (a -> b) -> NixAction e a -> NixAction e b #

liftA2 :: (a -> b -> c) -> NixAction e a -> NixAction e b -> NixAction e c #

(*>) :: NixAction e a -> NixAction e b -> NixAction e b #

(<*) :: NixAction e a -> NixAction e b -> NixAction e a #

MonadIO (NixAction e) Source # 
Instance details

Defined in Foreign.Nix.Shellout.Types

Methods

liftIO :: IO a -> NixAction e a #