From c3612b97e625ad0d70c6ba56d191bcb9a403f44c Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Fri, 14 Sep 2018 14:30:19 +0200 Subject: [PATCH] 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". --- pkgs/top-level/all-packages.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e3cb6069caf8..efce3051f064 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 = {