Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add example usage for gitea in tarball fetcher #11116

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions doc/manual/src/protocols/tarball-fetcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,23 @@ Link: <https://example.org/hello/442793d9ec0584f6a6e82fa253850c8085bb150a.tar.gz
For tarball flakes, the value of the `lastModified` flake attribute is
defined as the timestamp of the newest file inside the tarball.

## Gitea and Forgejo support

Since Gitea v1.22.1 and Forgejo v7.0.4/v8.0.0, this protocol is supported in both, which can be used like this:

```nix
{
inputs = {
gitea-repo-schema.url = "https://<instance hostname>/<owner>/<repo>/archive/<ref>.tar.gz";

main-branch.url = "https://gitea.example/johndoe/some-nix-flake/archive/main.tar.gz";
other-branch.url = "https://gitea2.example/someotherperson/other-flake/archive/other.tar.gz";
non-flake = {
url = "https://forgejo.example/random-person/random-non-flake-repo/archive/main.tar.gz";
flake = false;
};
};
}
```
fricklerhandwerk marked this conversation as resolved.
Show resolved Hide resolved

[Nix Archive]: @docroot@/store/file-system-object/content-address.md#serial-nix-archive
2 changes: 2 additions & 0 deletions src/nix/flake.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ Currently the `type` attribute can be one of the following:
`.tgz`, `.tar.gz`, `.tar.xz`, `.tar.bz2` or `.tar.zst`), then the `tarball+`
can be dropped.

This can also be used to set the location of gitea/forgejo branches. [See here](@docroot@/protocols/tarball-fetcher.md#gitea-and-forgejo-support)

* `file`: Plain files or directory tarballs, either over http(s) or from the local
disk.

Expand Down