update nixpkgs fetchers
Build & Push / Build & Push (push) Failing after 2m46s Details

This commit is contained in:
Antoine Langlois 2024-03-19 17:50:40 +01:00
parent 2a7e98a865
commit 905c93417e
Signed by: DataHearth
GPG Key ID: 946E2D0C410C7B3D
1 changed files with 313 additions and 28 deletions

View File

@ -11,41 +11,326 @@ Key differences are:
2. `builtins` produced a `path` to downloaded content. While `Nixpkgs` produced a `derivation`.
!!! info "Argument convention"
### Icons
- :material-alert:{ .alert-icon } : Required argument
- :octicons-question-24:{.optional-icon} : Optional argument
### Content
- `hash`: Must be a valid [`SRI`](https://developer.mozilla.org/fr/docs/Web/Security/Subresource_Integrity) hash. You can replace the argument `hash` by any supported hash algorithm (sha256, sha512, etc), and its content doesn't need to be a [`SRI`](https://developer.mozilla.org/fr/docs/Web/Security/Subresource_Integrity). By convention, `hash` is preferred.
Icons
- :material-alert:{ .alert-icon } : Required argument
- :octicons-question-24:{.optional-icon} : Optional argument
- :material-link: `ARG` : Default value mapped to another argument
Content
- `hash`: Must be a valid [`SRI`](https://developer.mozilla.org/fr/docs/Web/Security/Subresource_Integrity) hash.
### `Nixpkgs` fetchers
| Function | Description | Arguments |
| --- | --- | --- |
| [`fetchurl`](https://nixos.org/manual/nixpkgs/stable/#fetchurl){:target="_blank"} | Fetch remote resource without modification. | - :material-alert:{.alert-icon} `hash` <br /> - :material-alert:{.alert-icon} `url` |
| [`fetchzip`](https://nixos.org/manual/nixpkgs/stable/#fetchurl){:target="_blank"} | Fetch remote resource and extract it (tarball or zip). | - :material-alert:{.alert-icon} `hash` <br /> - :material-alert:{.alert-icon} `url` |
| [`fetchpatch`](https://nixos.org/manual/nixpkgs/stable/#fetchpatch){:target="_blank"} | Fetch remote `patch` file and normalize its content (remove comments or any other unstable parts). | - :material-alert:{.alert-icon} `hash` <br /> - :material-alert:{.alert-icon} `url` |
| [`fetchDebianPatch`](https://nixos.org/manual/nixpkgs/stable/#fetchdebianpatch){:target="_blank"} | Fetch `patch` file from <https://sources.debian.org> | - :material-alert:{.alert-icon} `pname` <br /> - :material-alert:{.alert-icon} `version` <br /> - :material-alert:{.alert-icon} `hash` <br /> - :material-alert:{.alert-icon} `patch` <br /> - :octicons-question-24:{.optional-icon} `debianRevision` <br /> - :octicons-question-24:{.optional-icon} `name` (default to `patch` arg) <br /> - :octicons-question-24:{.optional-icon} `area` (default to `main`) |
| [`fetchsvn`](https://nixos.org/manual/nixpkgs/stable/#fetchsvn){:target="_blank"} | Fetch resource from [`SVN`](https://subversion.apache.org/). | - :material-alert:{.alert-icon} `hash` <br /> - :material-alert:{.alert-icon} `url` <br /> - :octicons-question-24:{.optional-icon} rev (default to `HEAD`) <br /> |
| [`fetchgit`](https://nixos.org/manual/nixpkgs/stable/#fetchgit){:target="_blank"} | | |
| [`fetchfosille`](https://nixos.org/manual/nixpkgs/stable/#fetchfosille){:target="_blank"} | | |
| [`fetchcvs`](https://nixos.org/manual/nixpkgs/stable/#fetchcvs){:target="_blank"} | | |
| [`fetchhg`](https://nixos.org/manual/nixpkgs/stable/#fetchhg){:target="_blank"} | | |
| [`fetchFromGitea`](https://nixos.org/manual/nixpkgs/stable/#fetchfromgitea){:target="_blank"} | | |
| [`fetchFromGitHub`](https://nixos.org/manual/nixpkgs/stable/#fetchfromgithub){:target="_blank"} | | |
| [`fetchFromGitLab`](https://nixos.org/manual/nixpkgs/stable/#fetchfromgitlab){:target="_blank"} | | |
| [`fetchFromGitiles`](https://nixos.org/manual/nixpkgs/stable/#fetchfromgitiles){:target="_blank"} | | |
| [`fetchFromBitbucket`](https://nixos.org/manual/nixpkgs/stable/#fetchfrombitbucket){:target="_blank"} | | |
| [`fetchFromSavannah`](https://nixos.org/manual/nixpkgs/stable/#fetchfromsavannah){:target="_blank"} | | |
| [`fetchFromRepoOrCz`](https://nixos.org/manual/nixpkgs/stable/#fetchfromrepoorcz){:target="_blank"} | | |
| [`fetchfromsourcehut`](https://nixos.org/manual/nixpkgs/stable/#fetchfromsourcehut){:target="_blank"} | | |
| [`requireFile`](https://nixos.org/manual/nixpkgs/stable/#requirefile){:target="_blank"} | | |
| [`fetchtorrent`](https://nixos.org/manual/nixpkgs/stable/#fetchtorrent){:target="_blank"} | | |
!!! bug "WIP"
This section is a work in progress.
Not all fetchers are documented yet.
Nor all arguments are documented correctly (descriptions, types).
#### fetchurl
Fetch remote resource without modification.
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `url` | URL of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `urls` | List of URLs of the resource to fetch (tried in order) | `list` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `curlOpts` | Options to pass to `curl` (space seperated) | `string` | :octicons-question-24:{.optional-icon} | `""` |
| `curlOptsList` | Options to pass to `curl` | `list` | :octicons-question-24:{.optional-icon} | `[]` |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | basename of current `URL` |
| `pname` | Package name | `string` | :octicons-question-24:{.optional-icon} | `""` |
| `version` | Package version | `string` | :octicons-question-24:{.optional-icon} | `""` |
| `recursiveHash` | Recursive hash | `string` | :octicons-question-24:{.optional-icon} | `false` |
| `netrcPhase` | Shell code to build a netrc file for BASIC auth | `string` | :octicons-question-24:{.optional-icon} | |
| `netrcImpureEnvVars` | List of environment variables needed for the `netrcPhase` | `list` | :octicons-question-24:{.optional-icon} | `[]` |
| `postFetch` | Shell code executed after the file has been fetched successfully | `string` | :octicons-question-24:{.optional-icon} | `""` |
| `downloadToTemp` | Download to temporary path rather than `$out` | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `executable` | Make the file executable | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `showURLs` | Don't download the file, but write a list of all possible URLs to `$out` | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `meta` | Metadata | `any` | :octicons-question-24:{.optional-icon} | `{}` |
| `passthru` | Passthru information | `any` | :octicons-question-24:{.optional-icon} | `{}` |
| `preferLocalBuild` | Prefer local build | `boolean` | :octicons-question-24:{.optional-icon} | `true` |
| `nativeBuildInputs` | Additional packages needed as part of a fetch | `list` | :octicons-question-24:{.optional-icon} | `[]` |
#### fetchzip
Fetch remote resource and extract it (tarball or zip).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `name` | Name of the resource | `string` | :opticons-question-24:{.optional-icon} | `"source"` |
| `extraPostFetch` | Extra post fetch | `string` | :opticons-question-24:{.optional-icon} | `""` |
| `extension` | Extension of the resource | `string` | :opticons-question-24:{.optional-icon} | |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchpatch` takes the same arguments as `fetchurl`.
#### fetchpatch
Fetch remote `patch` file and normalize its content (remove comments or any other unstable parts).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `relative` | Relative path to the patch file | `string` | :material-alert:{.alert-icon} | |
| `stripLen` | Number of leading path components to strip | `int` | :octicons-question-24:{.optional-icon} | `0` |
| `decode` | Decode the patch file | `boolean` | :octicons-question-24:{.optional-icon} | `"cat"` |
| `extraPrefix` | Extra prefix | `string` | :octicons-question-24:{.optional-icon} | |
| `excludes` | Excludes | `list` | :octicons-question-24:{.optional-icon} | `[]` |
| `includes` | Includes | `list` | :octicons-question-24:{.optional-icon} | `[]` |
| `revert` | Revert | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchpatch` takes the same arguments as `fetchurl`.
#### fetchDebianPatch
Fetch `patch` file from <https://sources.debian.org>.
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `pname` | Package name | `string` | :material-alert:{.alert-icon} | |
| `version` | Package version | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `patch` | Patch name | `string` | :material-alert:{.alert-icon} | |
| `debianRevision` | Debian revision | `string` | :octicons-question-24:{.optional-icon} | |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | :material-link: `patch` |
| `area` | Area of the resource | `string` | :octicons-question-24:{.optional-icon} | `"main"` |
#### fetchsvn
Fetch resource from [`SVN`](https://subversion.apache.org/).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `url` | URL of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :octicons-question-24:{.optional-icon} | `"HEAD"` |
| `ignoreExternals` | Ignore externals | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `ignoreKeywords` | Ignore keywords | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | |
| `preferLocalBuild` | Prefer local build | `boolean` | :octicons-question-24:{.optional-icon} | `true` |
#### fetchgit
Fetch git repository.
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `url` | URL of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :octicons-question-24:{.optional-icon} | `"HEAD"` |
| `leaveDotGit` | Keep `.git` directory | `boolean` | :octicons-question-24:{.optional-icon} | :material-link: `deepClone` |
| `fetchSubmodules` | Fetch submodules | `boolean` | :octicons-question-24:{.optional-icon} | `true` |
| `deepClone` | Clone the entire repository instead of last commit | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `branchName` | Name of the branch to fetch | `string` | :octicons-question-24:{.optional-icon} | |
| `sparseCheckout` | Use sparse checkout | `boolean` | :octicons-question-24:{.optional-icon} | `[]` |
| `nonConeMode` | Use non-cone mode | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `meta` | Metadata | `any` | :octicons-question-24:{.optional-icon} | `{}` |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | `urlToName url rev` |
| `postFetch` | Post fetch command | `string` | :octicons-question-24:{.optional-icon} | `""` |
| `preferLocalBuild` | Prefer local build | `boolean` | :octicons-question-24:{.optional-icon} | `true` |
| `fetchLFS` | Fetch large file storage | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `netrcPhase` | Netrc phase | `string` | :octicons-question-24:{.optional-icon} | |
| `netrcImpureEnvVars` | Netrc impure environment variables | `string` | :octicons-question-24:{.optional-icon} | `[]` |
| `allowedRequisites` | Allowed requisites | `string` | :octicons-question-24:{.optional-icon} | |
#### fetchfossil
Fetch resource from [`Fossil`](https://www.fossil-scm.org/home/doc/trunk/www/index.wiki).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `url` | URL of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | |
#### fetchcvs
Fetch resource from [`CVS`](#).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `cvsRoot` | CVS root | `string` | :material-alert:{.alert-icon} | |
| `module` | Module | `string` | :material-alert:{.alert-icon} | |
| `sha256` | SHA256 hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `tag` | Tag | `string` | :octicons-question-24:{.optional-icon} | |
| `date` | Date | `string` | :octicons-question-24:{.optional-icon} | |
#### fetchhg
Fetch resource from [`Mercurial`](https://repo.mercurial-scm.org/hg-stable).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `url` | URL of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :octicons-question-24:{.optional-icon} | |
| `fetchSubrepos` | Fetch subrepositories | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `preferLocalBuild` | Prefer local build | `boolean` | :octicons-question-24:{.optional-icon} | `true` |
#### fetchFromGitea
Fetch git repository from a [`Gitea`](https://about.gitea.com/) instance.
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `domain` | Domain of the repository | `string` | :material-alert:{.alert-icon} | |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchFromGitea` takes the same arguments as `fetchFromGitHub`.
#### fetchFromGitHub
Fetch git repository from [`GitHub`](https://github.com).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `owner` | Owner of the repository | `string` | :material-alert:{.alert-icon} | |
| `repo` | Repository name | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | `"source"` |
| `fetchSubmodules` | Fetch submodules | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `leaveDotGit` | Keep `.git` directory | `boolean` | :octicons-question-24:{.optional-icon} | |
| `deepClone` | Clone the entire repository instead of last commit | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `private` | Repository is private | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `forceFetchGit` | Force fetch git | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `sparseCheckout` | Use sparse checkout | `boolean` | :octicons-question-24:{.optional-icon} | `[]` |
| `githubBase` | GitHub base | `string` | :octicons-question-24:{.optional-icon} | `"github.com"` |
| `varPrefix` | Variable prefix | `string` | :octicons-question-24:{.optional-icon} | |
| `meta` | Metadata | `any` | :octicons-question-24:{.optional-icon} | `{}` |
#### fetchFromGitLab
Fetch git repository from a [`Gitlab`](https://gitlab.com) instance.
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `owner` | Owner of the repository | `string` | :material-alert:{.alert-icon} | |
| `repo` | Repository name | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `protocol` | Protocol of the repository | `string` | :octicons-question-24:{.optional-icon} | `"https"` |
| `domain` | Domain of the repository | `string` | :octicons-question-24:{.optional-icon} | `"gitlab.com"` |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | `"source"` |
| `group` | Group of the repository | `string` | :octicons-question-24:{.optional-icon} | |
| `fetchSubmodules` | Fetch submodules | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `leaveDotGit` | Keep `.git` directory | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `deepClone` | Clone the entire repository instead of last commit | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `forceFetchGit` | Force fetch git | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `sparseCheckout` | Use sparse checkout | `boolean` | :octicons-question-24:{.optional-icon} | `[]` |
#### fetchFromGitiles
Fetch resource from [`Gitiles`](https://gerrit.googlesource.com/gitiles/).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchFromGitiles` takes the same arguments as `fetchzip`.
#### fetchFromBitbucket
Fetch git repository from [`Bitbucket`](https://bitbucket.org).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `owner` | Owner of the repository | `string` | :material-alert:{.alert-icon} | |
| `repo` | Repository name | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchFromBitbucket` takes the same arguments as `fetchzip`.
#### fetchFromSavannah
Fetch resource from [`Savannah`](https://savannah.gnu.org/).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `repo` | Repository name | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchFromSavannah` takes the same arguments as `fetchzip`.
#### fetchFromRepoOrCz
Fetch git repository from [`repo.or.cz`](https://repo.or.cz/).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `repo` | Repository name | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchFromRepoOrCz` takes the same arguments as `fetchzip`.
#### fetchfromsourcehut
Fetch git repository from [`sourcehut`](https://sourcehut.org/).
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `owner` | Owner of the repository | `string` | :material-alert:{.alert-icon} | |
| `repo` | Repository name | `string` | :material-alert:{.alert-icon} | |
| `rev` | Revision of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `domain` | Domain of the repository | `string` | :octicons-question-24:{.optional-icon} | `"git.sr.ht"` |
| `vc` | Version control system | `string` | :material-alert:{.alert-icon} | `"git"` (available: `"git"`, `"hg"`) |
| `fetchSubmodules` | Fetch submodules | `boolean` | :octicons-question-24:{.optional-icon} | `false` |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | `"source"` |
!!! info "Additionnal arguments"
Outside of the given arguments above, `fetchfromsourcehut` takes the same arguments as `fetchzip` for a `zip`, `fetchgit` for `git` and `fetchhg` for `hg`.
#### requireFile
Require a file from the local file system.
!!! danger "Incomplet documentation"
Due to lack of documentation and code, I didn't find a full usage of each args.
The arguments below are the one I found in the nix manual.
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `name` | Name of the resource | `string` | :material-alert:{.alert-icon} | |
| `url` | URL of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `message` | Custom error message | `string` | :octicons-question-24:{.optional-icon} | |
#### fetchtorrent
Fetch resource from a `.torrent` file.
| Argument name | Description | Type | Required | Default value |
| --- | --- | --- | --- | --- |
| `url` | URL of the resource to fetch | `string` | :material-alert:{.alert-icon} | |
| `hash` | SRI hash of the resource | `string` | :material-alert:{.alert-icon} | |
| `name` | Name of the resource | `string` | :octicons-question-24:{.optional-icon} | `bittorrent` or `"bittorrent-" + builtins.head (builtins.match urlRegexp url)` |
| `config` | Configuration | `any` | :octicons-question-24:{.optional-icon} | `{}` (for `transmission` backend) |
| `meta` | Metadata | `any` | :octicons-question-24:{.optional-icon} | `{}` |
| `backend` | Backend for downloading torrent | `string` | :octicons-question-24:{.optional-icon} | `"transmission"` |
| `recursiveHash` | Recursive hash | `string` | :octicons-question-24:{.optional-icon} | `true` |
| `postFetch` | Post fetch command | `string` | :octicons-question-24:{.optional-icon} | `""` |
| `postUnpack` | Post unpack command | `string` | :octicons-question-24:{.optional-icon} | `""` |
### `builtins` fetchers
| Function | Description | Arguments |
| --- | --- | --- |
| [`fetchClosure`](https://nixos.org/manual/nix/stable/language/builtins#builtins-fetchClosure) | | |