about summary refs log tree commit diff
path: root/pkgs/top-level/all-packages.nix
diff options
context:
space:
mode:
authorSymphorien Gibol <symphorien+git@xlumurb.eu>2018-09-14 14:30:19 +0200
committerSymphorien Gibol <symphorien+git@xlumurb.eu>2018-09-14 14:30:19 +0200
commitc3612b97e625ad0d70c6ba56d191bcb9a403f44c (patch)
treec3d3e8bb529a9ba3a0623bb68191e36cfe1467b5 /pkgs/top-level/all-packages.nix
parentca2ba44cab47767c8127d1c8633e2b581644eb8f (diff)
downloadnixlib-c3612b97e625ad0d70c6ba56d191bcb9a403f44c.tar
nixlib-c3612b97e625ad0d70c6ba56d191bcb9a403f44c.tar.gz
nixlib-c3612b97e625ad0d70c6ba56d191bcb9a403f44c.tar.bz2
nixlib-c3612b97e625ad0d70c6ba56d191bcb9a403f44c.tar.lz
nixlib-c3612b97e625ad0d70c6ba56d191bcb9a403f44c.tar.xz
nixlib-c3612b97e625ad0d70c6ba56d191bcb9a403f44c.tar.zst
nixlib-c3612b97e625ad0d70c6ba56d191bcb9a403f44c.zip
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".
Diffstat (limited to 'pkgs/top-level/all-packages.nix')
-rw-r--r--pkgs/top-level/all-packages.nix8
1 files 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 = {