Skip to content

Commit f0a1c13

Browse files
doc: add example usage for Gitea in tarball fetcher (#11116)
Co-authored-by: Valentin Gagarin <[email protected]>
1 parent 621c23b commit f0a1c13

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

doc/manual/src/protocols/tarball-fetcher.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,30 @@ Link: <https://example.org/hello/442793d9ec0584f6a6e82fa253850c8085bb150a.tar.gz
4141
For tarball flakes, the value of the `lastModified` flake attribute is
4242
defined as the timestamp of the newest file inside the tarball.
4343

44+
## Gitea and Forgejo support
45+
46+
This protocol is supported by Gitea since v1.22.1 and by Forgejo since v7.0.4/v8.0.0 and can be used with the following flake URL schema:
47+
48+
```
49+
https://<domain name>/<owner>/<repo>/archive/<reference or revison>.tar.gz
50+
```
51+
52+
> **Example**
53+
>
54+
>
55+
> ```nix
56+
> # flake.nix
57+
> {
58+
> inputs = {
59+
> foo.url = "https://gitea.example.org/some-person/some-flake/archive/main.tar.gz";
60+
> bar.url = "https://gitea.example.org/some-other-person/other-flake/archive/442793d9ec0584f6a6e82fa253850c8085bb150a.tar.gz";
61+
> qux = {
62+
> url = "https://forgejo.example.org/another-person/some-non-flake-repo/archive/development.tar.gz";
63+
> flake = false;
64+
> };
65+
> };
66+
> outputs = { foo, bar, qux }: { /* ... */ };
67+
> }
68+
```
69+
4470
[Nix Archive]: @docroot@/store/file-system-object/content-address.md#serial-nix-archive

src/nix/flake.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ Currently the `type` attribute can be one of the following:
259259
`.tgz`, `.tar.gz`, `.tar.xz`, `.tar.bz2` or `.tar.zst`), then the `tarball+`
260260
can be dropped.
261261

262+
This can also be used to set the location of gitea/forgejo branches. [See here](@docroot@/protocols/tarball-fetcher.md#gitea-and-forgejo-support)
263+
262264
* `file`: Plain files or directory tarballs, either over http(s) or from the local
263265
disk.
264266

0 commit comments

Comments
 (0)