summary refs log tree commit diff
diff options
context:
space:
mode:
authorMike Purvis <mpurvis@clearpath.ai>2021-09-15 17:33:20 +0000
committerMike Purvis <mpurvis@clearpath.ai>2021-09-20 16:08:16 +0000
commit04b8e12ec7686657d409d3be573c0b85012f7a3b (patch)
tree08126187fa2740ab71c1329dca085fc470f16c3b
parent2bb5cbf7f8b99a8d1d6646abe5ab993f6823212f (diff)
downloadnixpkgs-04b8e12ec7686657d409d3be573c0b85012f7a3b.tar
nixpkgs-04b8e12ec7686657d409d3be573c0b85012f7a3b.tar.gz
nixpkgs-04b8e12ec7686657d409d3be573c0b85012f7a3b.tar.bz2
nixpkgs-04b8e12ec7686657d409d3be573c0b85012f7a3b.tar.lz
nixpkgs-04b8e12ec7686657d409d3be573c0b85012f7a3b.tar.xz
nixpkgs-04b8e12ec7686657d409d3be573c0b85012f7a3b.tar.zst
nixpkgs-04b8e12ec7686657d409d3be573c0b85012f7a3b.zip
fetchFromGitLab: Allow overriding protocol
-rw-r--r--pkgs/build-support/fetchgitlab/default.nix8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/build-support/fetchgitlab/default.nix b/pkgs/build-support/fetchgitlab/default.nix
index 5b9dbd71c59..9ee0b3ca368 100644
--- a/pkgs/build-support/fetchgitlab/default.nix
+++ b/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:
@@ -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; }