Skip to content

Commit

Permalink
fetchFromGitLab: Allow overriding protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepurvis committed Sep 20, 2021
1 parent 2bb5cbf commit 04b8e12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkgs/build-support/fetchgitlab/default.nix
@@ -1,7 +1,7 @@
{ fetchgit, fetchzip, lib }:

# gitlab example
{ owner, repo, rev, domain ? "gitlab.com", name ? "source", group ? null
{ owner, repo, rev, protocol ? "https", domain ? "gitlab.com", name ? "source", group ? null
, fetchSubmodules ? false, leaveDotGit ? false, deepClone ? false
, ... # For hash agility
} @ args:
Expand All @@ -17,10 +17,10 @@ let

fetcherArgs = (if useFetchGit then {
inherit rev deepClone fetchSubmodules leaveDotGit;
url = "https://${domain}/${slug}.git";
url = "${protocol}://${domain}/${slug}.git";
} else {
url = "https://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${escapedRev}";
url = "${protocol}://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${escapedRev}";
}) // passthruAttrs // { inherit name; };
in

fetcher fetcherArgs // { meta.homepage = "https://${domain}/${slug}/"; inherit rev; }
fetcher fetcherArgs // { meta.homepage = "${protocol}://${domain}/${slug}/"; inherit rev; }

0 comments on commit 04b8e12

Please sign in to comment.