-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The renaming task is splatting everything together into markdown lists. The docs are temporily not rendered.
- Loading branch information
1 parent
f7f8874
commit c3dba55
Showing
10 changed files
with
431 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,131 +235,6 @@ static RegisterPrimOp primop_fetchTree({ | |
document) if `fetchTree` was a curried call with the first paramter for | ||
`type` or an attribute like `builtins.fetchTree.git`! --> | ||
- `"file"` | ||
Place a plain file into the Nix store. | ||
This is similar to [`builtins.fetchurl`](@docroot@/language/builtins.md#builtins-fetchurl) | ||
- `url` (String, required) | ||
Supported protocols: | ||
- `https` | ||
> **Example** | ||
> | ||
> ```nix | ||
> fetchTree { | ||
> type = "file"; | ||
> url = "https://example.com/index.html"; | ||
> } | ||
> ``` | ||
- `http` | ||
Insecure HTTP transfer for legacy sources. | ||
> **Warning** | ||
> | ||
> HTTP performs no encryption or authentication. | ||
> Use a `narHash` known in advance to ensure the output has expected contents. | ||
- `file` | ||
A file on the local file system. | ||
> **Example** | ||
> | ||
> ```nix | ||
> fetchTree { | ||
> type = "file"; | ||
> url = "file:///home/eelco/nix/README.md"; | ||
> } | ||
> ``` | ||
- `"tarball"` | ||
Download a tar archive and extract it into the Nix store. | ||
This has the same underyling implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball) | ||
- `url` (String, required) | ||
> **Example** | ||
> | ||
> ```nix | ||
> fetchTree { | ||
> type = "tarball"; | ||
> url = "https://github.com/NixOS/nixpkgs/tarball/nixpkgs-23.11"; | ||
> } | ||
> ``` | ||
- `"git"` | ||
Fetch a Git tree and copy it to the Nix store. | ||
This is similar to [`builtins.fetchGit`](@docroot@/language/builtins.md#builtins-fetchGit). | ||
- `url` (String, required) | ||
The URL formats supported are the same as for Git itself. | ||
> **Example** | ||
> | ||
> ```nix | ||
> fetchTree { | ||
> type = "git"; | ||
> url = "[email protected]:NixOS/nixpkgs.git"; | ||
> } | ||
> ``` | ||
> **Note** | ||
> | ||
> If the URL points to a local directory, and no `ref` or `rev` is given, Nix will only consider files added to the Git index, as listed by `git ls-files` but use the *current file contents* of the Git working directory. | ||
- `ref` (String, optional) | ||
A [Git reference](https://git-scm.com/book/en/v2/Git-Internals-Git-References), such as a branch or tag name. | ||
Default: `"HEAD"` | ||
- `rev` (String, optional) | ||
A Git revision; a commit hash. | ||
Default: the tip of `ref` | ||
- `shallow` (Bool, optional) | ||
Make a shallow clone when fetching the Git tree. | ||
Default: `false` | ||
- `submodules` (Bool, optional) | ||
Also fetch submodules if available. | ||
Default: `false` | ||
- `allRefs` (Bool, optional) | ||
If set to `true`, always fetch the entire repository, even if the latest commit is still in the cache. | ||
Otherwise, only the latest commit is fetched if it is not already cached. | ||
Default: `false` | ||
- `lastModified` (Integer, optional) | ||
Unix timestamp of the fetched commit. | ||
If set, pass through the value to the output attribute set. | ||
Otherwise, generated from the fetched Git tree. | ||
- `revCount` (Integer, optional) | ||
Number of revisions in the history of the Git repository before the fetched commit. | ||
If set, pass through the value to the output attribute set. | ||
Otherwise, generated from the fetched Git tree. | ||
The following input types are still subject to change: | ||
- `"path"` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,26 +191,163 @@ struct GitInputScheme : InputScheme | |
return "git"; | ||
} | ||
|
||
StringSet allowedAttrs() const override | ||
std::string schemeDescription() const override | ||
{ | ||
return stripIndentation(R"( | ||
Fetch a Git tree and copy it to the Nix store. | ||
This is similar to [`builtins.fetchGit`](@docroot@/language/builtins.md#builtins-fetchGit). | ||
)"); | ||
} | ||
|
||
std::map<std::string, AttributeInfo> allowedAttrs() const override | ||
{ | ||
return { | ||
"url", | ||
"ref", | ||
"rev", | ||
"shallow", | ||
"submodules", | ||
"exportIgnore", | ||
"lastModified", | ||
"revCount", | ||
"narHash", | ||
"allRefs", | ||
"name", | ||
"dirtyRev", | ||
"dirtyShortRev", | ||
"verifyCommit", | ||
"keytype", | ||
"publicKey", | ||
"publicKeys", | ||
{ | ||
"url", | ||
{ | ||
.type = "String", | ||
.required = true, | ||
.doc = R"( | ||
The URL formats supported are the same as for Git itself. | ||
> **Example** | ||
> | ||
> ```nix | ||
> fetchTree { | ||
> type = "git"; | ||
> url = "[email protected]:NixOS/nixpkgs.git"; | ||
> } | ||
> ``` | ||
> **Note** | ||
> | ||
> If the URL points to a local directory, and no `ref` or `rev` is given, Nix will only consider files added to the Git index, as listed by `git ls-files` but use the *current file contents* of the Git working directory. | ||
)", | ||
}, | ||
}, | ||
{ | ||
"ref", | ||
{ | ||
.type = "String", | ||
.required = false, | ||
.doc = R"( | ||
A [Git reference](https://git-scm.com/book/en/v2/Git-Internals-Git-References), such as a branch or tag name. | ||
Default: `"HEAD"` | ||
)", | ||
}, | ||
}, | ||
{ | ||
"rev", | ||
{ | ||
.type = "String", | ||
.required = false, | ||
.doc = R"( | ||
A Git revision; a commit hash. | ||
Default: the tip of `ref` | ||
)", | ||
}, | ||
}, | ||
{ | ||
"shallow", | ||
{ | ||
.type = "Bool", | ||
.required = false, | ||
.doc = R"( | ||
Make a shallow clone when fetching the Git tree. | ||
Default: `false` | ||
)", | ||
}, | ||
}, | ||
{ | ||
"submodules", | ||
{ | ||
.type = "Bool", | ||
.required = false, | ||
.doc = R"( | ||
Also fetch submodules if available. | ||
Default: `false` | ||
)", | ||
}, | ||
}, | ||
{ | ||
"lastModified", | ||
{ | ||
.type = "integer", | ||
.required = false, | ||
.doc = R"( | ||
Unix timestamp of the fetched commit. | ||
If set, pass through the value to the output attribute set. | ||
Otherwise, generated from the fetched Git tree. | ||
)", | ||
}, | ||
}, | ||
{ | ||
"revCount", | ||
{ | ||
.type = "integer", | ||
.required = false, | ||
.doc = R"( | ||
Number of revisions in the history of the Git repository before the fetched commit. | ||
If set, pass through the value to the output attribute set. | ||
Otherwise, generated from the fetched Git tree. | ||
)", | ||
}, | ||
}, | ||
{ | ||
"narHash", | ||
{}, | ||
}, | ||
{ | ||
"allRefs", | ||
{ | ||
.type = "Bool", | ||
.required = false, | ||
.doc = R"( | ||
If set to `true`, always fetch the entire repository, even if the latest commit is still in the cache. | ||
Otherwise, only the latest commit is fetched if it is not already cached. | ||
Default: `false` | ||
)", | ||
}, | ||
}, | ||
{ | ||
"name", | ||
{}, | ||
}, | ||
{ | ||
"dirtyRev", | ||
{}, | ||
}, | ||
{ | ||
"dirtyShortRev", | ||
{}, | ||
}, | ||
{ | ||
"exportIgnore", | ||
{}, | ||
}, | ||
{ | ||
"verifyCommit", | ||
{}, | ||
}, | ||
{ | ||
"keytype", | ||
{}, | ||
}, | ||
{ | ||
"publicKey", | ||
{}, | ||
}, | ||
{ | ||
"publicKeys", | ||
{}, | ||
}, | ||
}; | ||
} | ||
|
||
|
Oops, something went wrong.