diff options
author | Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> | 2023-03-31 13:21:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 13:21:55 +0200 |
commit | bb6e1244a3b69a659abd2a6086542ef2e32be4ec (patch) | |
tree | f80a4a617a2dcba49720e3fc8c190d29ce90a9f0 /src/nix | |
parent | e32ca3cf16a421297a545607c95dbe9918505987 (diff) | |
parent | a5ab253e8f9ac5010937f8b1f1edee3e29f5c076 (diff) |
Merge pull request #7406 from amesgen/gitlab-fetcher
Document `gitlab` input scheme
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/flake.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/nix/flake.md b/src/nix/flake.md index cd9f656e3..d70f34eeb 100644 --- a/src/nix/flake.md +++ b/src/nix/flake.md @@ -221,11 +221,46 @@ Currently the `type` attribute can be one of the following: commit hash (`rev`). Note that unlike Git, GitHub allows fetching by commit hash without specifying a branch or tag. + You can also specify `host` as a parameter, to point to a custom GitHub + Enterprise server. + Some examples: * `github:edolstra/dwarffs` * `github:edolstra/dwarffs/unstable` * `github:edolstra/dwarffs/d3f2baba8f425779026c6ec04021b2e927f61e31` + * `github:internal/project?host=company-github.example.org` + +* `gitlab`: Similar to `github`, is a more efficient way to fetch + GitLab repositories. 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 `gitlab` flakes is: + + `gitlab:<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 GitLab allows for self-hosting, you can specify `host` as + a parameter, to point to any instances other than `gitlab.com`. + + Some examples: + + * `gitlab:veloren/veloren` + * `gitlab:veloren/veloren/master` + * `gitlab:veloren/veloren/80a4d7f13492d916e47d6195be23acae8001985a` + * `gitlab:openldap/openldap?host=git.openldap.org` + + When accessing a project in a (nested) subgroup, make sure to URL-encode any + slashes, i.e. replace `/` with `%2F`: + + * `gitlab:veloren%2Fdev/rfcs` * `sourcehut`: Similar to `github`, is a more efficient way to fetch SourceHut repositories. The following attributes are required: |