Copyright | (c) 2021-2022 berberman |
---|---|
License | MIT |
Maintainer | berberman <[email protected]> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
NixFetcher
is used to describe how to fetch package sources.
There are five types of fetchers overall:
FetchGit
-- nix-prefetch-gitFetchGitHub
-- nix-prefetch-git/nix-prefetch-urlFetchUrl
-- nix-prefetch-urlFetchTarball
-- nix-prefetch-urlFetchDocker
-- nix-prefetch-docker
As you can see the type signature of prefetch
:
a fetcher will be filled with the fetch result (hash) after the prefetch.
Synopsis
- data RunFetch = RunFetch ForceFetch (NixFetcher Fresh)
- data ForceFetch
- data NixFetcher (k :: FetchStatus)
- = FetchGit {
- _furl :: Text
- _rev :: Version
- _deepClone :: Bool
- _fetchSubmodules :: Bool
- _leaveDotGit :: Bool
- _sparseCheckout :: [Text]
- _name :: Maybe Text
- _sha256 :: FetchResult Checksum k
- | FetchGitHub {
- _fowner :: Text
- _frepo :: Text
- _rev :: Version
- _deepClone :: Bool
- _fetchSubmodules :: Bool
- _leaveDotGit :: Bool
- _sparseCheckout :: [Text]
- _name :: Maybe Text
- _sha256 :: FetchResult Checksum k
- | FetchUrl { }
- | FetchTarball {
- _furl :: Text
- _sha256 :: FetchResult Checksum k
- | FetchDocker {
- _imageName :: Text
- _imageTag :: Text
- _imageDigest :: FetchResult ContainerDigest k
- _sha256 :: FetchResult Checksum k
- _fos :: Maybe Text
- _farch :: Maybe Text
- _finalImageName :: Maybe Text
- _finalImageTag :: Maybe Text
- _tlsVerify :: Maybe Bool
- = FetchGit {
- data FetchStatus
- type family FetchResult a (k :: FetchStatus) where ...
- prefetchRule :: Rules ()
- prefetch :: NixFetcher Fresh -> ForceFetch -> Action (Maybe (NixFetcher Fetched))
- gitHubFetcher :: (Text, Text) -> PackageFetcher
- pypiFetcher :: Text -> PackageFetcher
- gitHubReleaseFetcher :: (Text, Text) -> Text -> PackageFetcher
- gitHubReleaseFetcher' :: (Text, Text) -> (Version -> Text) -> PackageFetcher
- gitFetcher :: Text -> PackageFetcher
- urlFetcher :: Text -> NixFetcher Fresh
- urlFetcher' :: Text -> Maybe Text -> NixFetcher Fresh
- openVsxFetcher :: (Text, Text) -> PackageFetcher
- vscodeMarketplaceFetcher :: (Text, Text) -> PackageFetcher
- tarballFetcher :: Text -> NixFetcher Fresh
Types
The input of prefetch rule
Instances
Generic RunFetch Source # | |
Show RunFetch Source # | |
Binary RunFetch Source # | |
NFData RunFetch Source # | |
Defined in NvFetcher.Types | |
Eq RunFetch Source # | |
Ord RunFetch Source # | |
Defined in NvFetcher.Types | |
Hashable RunFetch Source # | |
Defined in NvFetcher.Types | |
type Rep RunFetch Source # | |
Defined in NvFetcher.Types type Rep RunFetch = D1 ('MetaData "RunFetch" "NvFetcher.Types" "nvfetcher-0.7.0.0-E76LQsRhWAxEniEZnhJWIT" 'False) (C1 ('MetaCons "RunFetch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ForceFetch) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NixFetcher 'Fresh)))) | |
type RuleResult RunFetch Source # | |
Defined in NvFetcher.Types |
data ForceFetch Source #
Whether to cache the fetched sha256
ForceFetch
indicates alwaysRerun
the fetcher rule
Instances
data NixFetcher (k :: FetchStatus) Source #
If the package is prefetched, then we can obtain the SHA256
FetchGit | |
| |
FetchGitHub | |
| |
FetchUrl | |
FetchTarball | |
| |
FetchDocker | |
|
Instances
type family FetchResult a (k :: FetchStatus) where ... Source #
Prefetched fetchers hold hashes
FetchResult _ Fresh = () | |
FetchResult a Fetched = a |
Rules
prefetchRule :: Rules () Source #
Rules of nix fetcher
prefetch :: NixFetcher Fresh -> ForceFetch -> Action (Maybe (NixFetcher Fetched)) Source #
Run nix fetcher
Functions
:: (Text, Text) | owner and repo |
-> PackageFetcher |
Create a fetcher from github repo
pypiFetcher :: Text -> PackageFetcher Source #
Create a fetcher from pypi
:: (Text, Text) | owner and repo |
-> Text | file name |
-> PackageFetcher |
Create a fetcher from github release
gitHubReleaseFetcher' Source #
:: (Text, Text) | owner and repo |
-> (Version -> Text) | file name computed from version |
-> 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
urlFetcher' :: Text -> Maybe Text -> NixFetcher Fresh Source #
Create a fetcher from url specifying the file name
:: (Text, Text) | publisher and extension name |
-> PackageFetcher |
Create a fetcher from openvsx
vscodeMarketplaceFetcher Source #
:: (Text, Text) | publisher and extension name |
-> PackageFetcher |
Create a fetcher from vscode marketplace
tarballFetcher :: Text -> NixFetcher Fresh Source #
Create a fetcher from url, using fetchTarball