-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Gitea fetcher for flake inputs #11467
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -364,6 +364,33 @@ Currently the `type` attribute can be one of the following: | |||||
* `sourcehut:~misterio/nix-colors/182b4b8709b8ffe4e9774a4c5d6877bf6bb9a21c` | ||||||
* `sourcehut:~misterio/nix-colors/21c1a380a6915d890d408e9f22203436a35bb2de?host=hg.sr.ht` | ||||||
|
||||||
* `gitea`: Similar to `github`, is a more efficient way to fetch | ||||||
Gitea/Forgejo repositories. The default host is `codeberg.org`. | ||||||
The following attributes are required: | ||||||
|
||||||
* `owner`: The owner of the repository. | ||||||
|
||||||
* `repo`: The name of the repository. | ||||||
|
||||||
Like `github`, these are downloaded as tarball archives. | ||||||
|
||||||
The URL syntax for `gitea` flakes is: | ||||||
|
||||||
`gitea:<owner>/<repo>(/<rev-or-ref>)?(\?<params>)?` | ||||||
|
||||||
`<rev-or-ref>` works the same as `github`. Either a branch or tag name | ||||||
(`ref`), or a commit hash (`rev`) can be specified. | ||||||
|
||||||
Since Gitea/Forgejo allows for self-hosting, you can specify `host` as | ||||||
a parameter, to point to any instances other than `codeberg.org`. | ||||||
|
||||||
Some examples: | ||||||
|
||||||
* `gitea:redict/redict` | ||||||
* `gitea:redict/redict/main` | ||||||
* `gitea:redict/redict/a4c81102327bc2c74d229784a1d1dd680c708918` | ||||||
* `gitea:lix-project/lix?host=git.lix.systems` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we actually should default to codeberg and not just make the host part of the url? This doesn't look much more complex and promotes self-hosting (which is in the spirit of gitea):
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should also support this?
Also some-subdirectory could become a url parameter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that we should support sub-directory. Though, I'd like to keep the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What do you mean by subdirectories? Subdirectories in the gitea repository are already supported with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think we should actually default to codeberg becuase. I just use codeberg and wanted to quickly simplify my flakes. I currently have an implementation which requires the specification of the host in the url in the |
||||||
|
||||||
# Flake format | ||||||
|
||||||
As an example, here is a simple `flake.nix` that depends on the | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about http with the s? Might be used for testing.