Unverified Commit e3fd1081 authored by Gergő Gutyina's avatar Gergő Gutyina Committed by GitHub
Browse files

fetchFrom{Forgejo,Codeberg}: init, treewide: fetchFromGitea -> fetchFromCodeberg, docs (#483216)

parents f6d47d24 35624035
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -855,9 +855,11 @@ Used with Mercurial. Expects `url`, `rev`, `hash`, overridable with [`<pkg>.over

A number of fetcher functions wrap part of `fetchurl` and `fetchzip`. They are mainly convenience functions intended for commonly used destinations of source code in Nixpkgs. These wrapper fetchers are listed below.

## `fetchFromGitea` {#fetchfromgitea}
## `fetchFromGitea`, `fetchFromForgejo` and `fetchFromCodeberg` {#fetchfromgitea}

`fetchFromGitea` expects five arguments. `domain` is the gitea server name. `owner` is a string corresponding to the Gitea user or organization that controls this repository. `repo` corresponds to the name of the software repository. These are located at the top of every Gitea HTML page as `owner`/`repo`. `rev` corresponds to the Git commit hash or tag (e.g `v1.0`) that will be downloaded from Git. Finally, `hash` corresponds to the hash of the extracted directory. Again, other hash algorithms are also available but `hash` is currently preferred.
`fetchFromGitea`, also aliased to `fetchFromForgejo`, expects five arguments. `domain` is the Gitea/Forgejo server name. `owner` is a string corresponding to the user or organization that controls this repository. `repo` corresponds to the name of the software repository. These are located at the top of every Gitea/Forgejo HTML page as `owner`/`repo`. `rev` corresponds to the Git commit hash or tag (e.g `v1.0`) that will be downloaded from Git. Finally, `hash` corresponds to the hash of the extracted directory. Again, other hash algorithms are also available but `hash` is currently preferred.

As <codeberg.org> is currently the most popular public Forgejo server, the `fetchFromCodeberg` fetcher is also available, which pre-fills the `domain` attribute.

## `fetchFromGitHub` {#fetchfromgithub}

+2 −3
Original line number Diff line number Diff line
{
  lib,
  vimUtils,
  fetchFromGitea,
  fetchFromCodeberg,
  nix-update-script,
  vimPlugins,
}:
@@ -9,8 +9,7 @@ vimUtils.buildVimPlugin {
  pname = "cmp-async-path";
  version = "0-unstable-2026-01-09";

  src = fetchFromGitea {
    domain = "codeberg.org";
  src = fetchFromCodeberg {
    owner = "FelipeLema";
    repo = "cmp-async-path";
    rev = "9c2374deb32c2bec8b27e928c6f57090e9a875d2";
+2 −3
Original line number Diff line number Diff line
{
  lib,
  vimUtils,
  fetchFromGitea,
  fetchFromCodeberg,
  nix-update-script,
}:
vimUtils.buildVimPlugin {
  pname = "zig.vim";
  version = "0-unstable-2026-01-16";

  src = fetchFromGitea {
    domain = "codeberg.org";
  src = fetchFromCodeberg {
    owner = "ziglang";
    repo = "zig.vim";
    rev = "fc01f73ce0636723a03b784b63a7a89f2f9a84ae";
+2 −3
Original line number Diff line number Diff line
{
  lib,
  fetchurl,
  fetchFromGitea,
  fetchFromCodeberg,
}:
let
  src = lib.importJSON ./src.json;
in
{
  inherit (src) packageVersion;
  source = fetchFromGitea (
  source = fetchFromCodeberg (
    src.source
    // {
      domain = "codeberg.org";
      owner = "librewolf";
      repo = "source";
      fetchSubmodules = true;
+2 −0
Original line number Diff line number Diff line
{ lib, fetchFromGitea }:
lib.makeOverridable (args: fetchFromGitea ({ domain = "codeberg.org"; } // args))
Loading