nvfetcher-0.4.0.0: Generate nix sources expr for the latest version of packages
Copyright(c) 2021 berberman
LicenseMIT
Maintainerberberman <[email protected]>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

NvFetcher.NixFetcher

Description

NixFetcher is used to describe how to fetch package sources.

There are three types of fetchers overall:

  1. FetchGit -- nix-prefetch fetchgit
  2. FetchGitHub -- nix-prefetch fetchFromGitHub
  3. FetchUrl -- nix-prefetch fetchurl

As you can see the type signature of prefetch: a fetcher will be filled with the fetch result (hash) after the prefetch.

Synopsis

Types

data NixFetcher (k :: FetchStatus) Source #

If the package is prefetched, then we can obtain the SHA256

Instances

Instances details
Eq (FetchResult k) => Eq (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

Methods

(==) :: NixFetcher k -> NixFetcher k -> Bool #

(/=) :: NixFetcher k -> NixFetcher k -> Bool #

Ord (FetchResult k) => Ord (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

Show (FetchResult k) => Show (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

Generic (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

Associated Types

type Rep (NixFetcher k) :: Type -> Type #

Methods

from :: NixFetcher k -> Rep (NixFetcher k) x #

to :: Rep (NixFetcher k) x -> NixFetcher k #

Hashable (FetchResult k) => Hashable (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

Methods

hashWithSalt :: Int -> NixFetcher k -> Int #

hash :: NixFetcher k -> Int #

Binary (FetchResult k) => Binary (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

Methods

put :: NixFetcher k -> Put #

get :: Get (NixFetcher k) #

putList :: [NixFetcher k] -> Put #

NFData (FetchResult k) => NFData (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

Methods

rnf :: NixFetcher k -> () #

ToNixExpr (NixFetcher 'Fresh) Source # 
Instance details

Defined in NvFetcher.NixExpr

ToNixExpr (NixFetcher 'Fetched) Source # 
Instance details

Defined in NvFetcher.NixExpr

type Rep (NixFetcher k) Source # 
Instance details

Defined in NvFetcher.Types

type Rep (NixFetcher k) = D1 ('MetaData "NixFetcher" "NvFetcher.Types" "nvfetcher-0.4.0.0-2zPYeAZ7I3cC6vD5RskllZ" 'False) (C1 ('MetaCons "FetchGit" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_furl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_rev") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version) :*: S1 ('MetaSel ('Just "_deepClone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :*: (S1 ('MetaSel ('Just "_fetchSubmodules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "_leaveDotGit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "_sha256") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (FetchResult k))))) :+: (C1 ('MetaCons "FetchGitHub" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_fowner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_frepo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_rev") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version))) :*: ((S1 ('MetaSel ('Just "_deepClone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "_fetchSubmodules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "_leaveDotGit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "_sha256") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (FetchResult k))))) :+: C1 ('MetaCons "FetchUrl" 'PrefixI 'True) (S1 ('MetaSel ('Just "_furl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_sha256") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (FetchResult k)))))
type RuleResult (NixFetcher 'Fresh) Source # 
Instance details

Defined in NvFetcher.Types

data FetchStatus Source #

Fetch status

Constructors

Fresh 
Fetched 

type family FetchResult (k :: FetchStatus) where ... Source #

Prefetched fetchers hold hashes

Rules

prefetchRule :: Rules () Source #

Rules of nix fetcher

Functions

gitHubFetcher Source #

Arguments

:: (Text, Text)

owner and repo

-> PackageFetcher 

Create a fetcher from github repo

pypiFetcher :: Text -> PackageFetcher Source #

Create a fetcher from pypi

gitHubReleaseFetcher Source #

Arguments

:: (Text, Text)

owner and repo

-> Text

file name

-> PackageFetcher 

Create a fetcher from github release

gitFetcher :: Text -> PackageFetcher Source #

Create a fetcher from git url

urlFetcher :: Text -> NixFetcher Fresh Source #

Create a fetcher from url

openVsxFetcher Source #

Arguments

:: (Text, Text)

publisher and extension name

-> PackageFetcher 

Create a fetcher from openvsx

vscodeMarketplaceFetcher Source #

Arguments

:: (Text, Text)

publisher and extension name

-> PackageFetcher 

Create a fetcher from vscode marketplace