cabal2nix-2.19.0: Convert Cabal files into Nix build instructions.
Safe HaskellNone
LanguageHaskell2010

Distribution.Nixpkgs.Fetch

Synopsis

Documentation

data Source Source #

A source is a location from which we can fetch, such as a HTTP URL, a GIT URL, ....

Constructors

Source 

Fields

Instances

Instances details
Eq Source Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

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

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

Ord Source Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Show Source Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Generic Source Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Associated Types

type Rep Source :: Type -> Type #

Methods

from :: Source -> Rep Source x #

to :: Rep Source x -> Source #

NFData Source Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

rnf :: Source -> () #

type Rep Source Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

type Rep Source = D1 ('MetaData "Source" "Distribution.Nixpkgs.Fetch" "cabal2nix-2.19.0-G0ZmTwEwyAGDiR9XTFX1hL" 'False) (C1 ('MetaCons "Source" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sourceUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "sourceRevision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just "sourceHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Hash) :*: S1 ('MetaSel ('Just "sourceCabalDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

data Hash Source #

Instances

Instances details
Eq Hash Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

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

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

Ord Hash Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

compare :: Hash -> Hash -> Ordering #

(<) :: Hash -> Hash -> Bool #

(<=) :: Hash -> Hash -> Bool #

(>) :: Hash -> Hash -> Bool #

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

max :: Hash -> Hash -> Hash #

min :: Hash -> Hash -> Hash #

Show Hash Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

showsPrec :: Int -> Hash -> ShowS #

show :: Hash -> String #

showList :: [Hash] -> ShowS #

Generic Hash Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Associated Types

type Rep Hash :: Type -> Type #

Methods

from :: Hash -> Rep Hash x #

to :: Rep Hash x -> Hash #

NFData Hash Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

rnf :: Hash -> () #

type Rep Hash Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

type Rep Hash = D1 ('MetaData "Hash" "Distribution.Nixpkgs.Fetch" "cabal2nix-2.19.0-G0ZmTwEwyAGDiR9XTFX1hL" 'False) (C1 ('MetaCons "Certain" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: (C1 ('MetaCons "Guess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "UnknownHash" 'PrefixI 'False) (U1 :: Type -> Type)))

data DerivationSource Source #

A source for a derivation. It always needs a hash and also has a protocol attached to it (url, git, svn, ...). A DerivationSource also always has it's revision fully resolved (not relative revisions like master, HEAD, etc).

Constructors

DerivationSource 

Fields

Instances

Instances details
Show DerivationSource Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Generic DerivationSource Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Associated Types

type Rep DerivationSource :: Type -> Type #

NFData DerivationSource Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

rnf :: DerivationSource -> () #

FromJSON DerivationSource Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Pretty DerivationSource Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

type Rep DerivationSource Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

type Rep DerivationSource = D1 ('MetaData "DerivationSource" "Distribution.Nixpkgs.Fetch" "cabal2nix-2.19.0-G0ZmTwEwyAGDiR9XTFX1hL" 'False) (C1 ('MetaCons "DerivationSource" 'PrefixI 'True) ((S1 ('MetaSel ('Just "derivKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DerivKind)) :*: S1 ('MetaSel ('Just "derivUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just "derivRevision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "derivHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "derivSubmodule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))))

data DerivKind Source #

Instances

Instances details
Show DerivKind Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Generic DerivKind Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Associated Types

type Rep DerivKind :: Type -> Type #

NFData DerivKind Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

rnf :: DerivKind -> () #

type Rep DerivKind Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

type Rep DerivKind = D1 ('MetaData "DerivKind" "Distribution.Nixpkgs.Fetch" "cabal2nix-2.19.0-G0ZmTwEwyAGDiR9XTFX1hL" 'False) ((C1 ('MetaCons "DerivKindUrl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnpackArchive)) :+: C1 ('MetaCons "DerivKindGit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FetchSubmodules))) :+: (C1 ('MetaCons "DerivKindHg" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DerivKindSvn" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DerivKindBzr" 'PrefixI 'False) (U1 :: Type -> Type))))

derivKindFunction :: DerivKind -> String Source #

The nixpkgs function to use for fetching this kind of derivation

data FetchSubmodules Source #

Whether to fetch submodules (git).

Instances

Instances details
Show FetchSubmodules Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Generic FetchSubmodules Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Associated Types

type Rep FetchSubmodules :: Type -> Type #

NFData FetchSubmodules Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

rnf :: FetchSubmodules -> () #

type Rep FetchSubmodules Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

type Rep FetchSubmodules = D1 ('MetaData "FetchSubmodules" "Distribution.Nixpkgs.Fetch" "cabal2nix-2.19.0-G0ZmTwEwyAGDiR9XTFX1hL" 'False) (C1 ('MetaCons "FetchSubmodules" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DontFetchSubmodules" 'PrefixI 'False) (U1 :: Type -> Type))

data UnpackArchive Source #

Whether to unpack an archive after fetching, before putting it into the nix store.

Instances

Instances details
Show UnpackArchive Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Generic UnpackArchive Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Associated Types

type Rep UnpackArchive :: Type -> Type #

NFData UnpackArchive Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

Methods

rnf :: UnpackArchive -> () #

type Rep UnpackArchive Source # 
Instance details

Defined in Distribution.Nixpkgs.Fetch

type Rep UnpackArchive = D1 ('MetaData "UnpackArchive" "Distribution.Nixpkgs.Fetch" "cabal2nix-2.19.0-G0ZmTwEwyAGDiR9XTFX1hL" 'False) (C1 ('MetaCons "UnpackArchive" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DontUnpackArchive" 'PrefixI 'False) (U1 :: Type -> Type))

fetch Source #

Arguments

:: forall a. FetchSubmodules

whether to fetch submodules when the source is a git repository

-> (String -> MaybeT IO a)

This function is passed the output path name as an argument. It should return Nothing if the file doesn't match the expected format. This is required, because we cannot always check if a download succeeded otherwise.

-> Source

The source to fetch from.

-> IO (Maybe (DerivationSource, a))

The derivation source and the result of the processing function. Returns Nothing if the download failed.

Fetch a source, trying any of the various nix-prefetch-* scripts.

fetchWith :: (Bool, DerivKind) -> Source -> MaybeT IO (DerivationSource, FilePath) Source #

Like fetch, but allows to specify which script to use.