mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
11 lines
613 B
Nix
11 lines
613 B
Nix
|
{ fetchzip, lib }:
|
||
|
|
||
|
# gitlab example
|
||
|
{ owner, repo, rev, domain ? "gitlab.com", name ? "source", group ? null
|
||
|
, ... # For hash agility
|
||
|
}@args: fetchzip ({
|
||
|
inherit name;
|
||
|
url = "https://${domain}/api/v4/projects/${lib.optionalString (group != null) "${lib.replaceStrings ["."] ["%2E"] group}%2F"}${lib.replaceStrings ["."] ["%2E"] owner}%2F${lib.replaceStrings ["."] ["%2E"] 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; }
|