diff options
author | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2018-09-14 14:30:19 +0200 |
---|---|---|
committer | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2018-09-14 14:30:19 +0200 |
commit | c3612b97e625ad0d70c6ba56d191bcb9a403f44c (patch) | |
tree | c3d3e8bb529a9ba3a0623bb68191e36cfe1467b5 | |
parent | ca2ba44cab47767c8127d1c8633e2b581644eb8f (diff) |
fetchFromGitLab: add a group optional argument
For example, paperwork is at https://gitlab.gnome.org/World/OpenPaperwork/paperwork and you can fetch this repo with group = "World", owner = "OpenPaperwork", and repo = "paperwork".
-rw-r--r-- | pkgs/top-level/all-packages.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e3cb6069caf8d..efce3051f0649 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -288,13 +288,13 @@ with pkgs; # gitlab example fetchFromGitLab = { - owner, repo, rev, domain ? "gitlab.com", name ? "source", + owner, repo, rev, domain ? "gitlab.com", name ? "source", group ? null, ... # For hash agility }@args: fetchzip ({ inherit name; - url = "https://${domain}/api/v4/projects/${owner}%2F${repo}/repository/archive.tar.gz?sha=${rev}"; - meta.homepage = "https://${domain}/${owner}/${repo}/"; - } // removeAttrs args [ "domain" "owner" "repo" "rev" ]) // { inherit rev; }; + url = "https://${domain}/api/v4/projects/${lib.optionalString (group != null) group+"%2F"}${owner}%2F${repo}/repository/archive.tar.gz?sha=${rev}"; + meta.homepage = "https://${domain}/${lib.optionalString (group != null) group+"/"}${owner}/${repo}/"; + } // removeAttrs args [ "domain" "owner" "group" "repo" "rev" ]) // { inherit rev; }; # gitweb example, snapshot support is optional in gitweb fetchFromRepoOrCz = { |