summary refs log tree commit diff
path: root/pkgs/build-support/fetchgitlab/default.nix
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2022-05-24 18:03:46 +0200
committerJan Tojnar <jtojnar@gmail.com>2022-05-24 19:12:12 +0200
commit7aae279ad9aacbf09293912939c2ba5795033f60 (patch)
tree6e36846fa2c8b10ef908468faa8f3d56288697b5 /pkgs/build-support/fetchgitlab/default.nix
parent1daa1ede66c69d146407dc9379f6d40de4e51d0d (diff)
downloadnixpkgs-7aae279ad9aacbf09293912939c2ba5795033f60.tar
nixpkgs-7aae279ad9aacbf09293912939c2ba5795033f60.tar.gz
nixpkgs-7aae279ad9aacbf09293912939c2ba5795033f60.tar.bz2
nixpkgs-7aae279ad9aacbf09293912939c2ba5795033f60.tar.lz
nixpkgs-7aae279ad9aacbf09293912939c2ba5795033f60.tar.xz
nixpkgs-7aae279ad9aacbf09293912939c2ba5795033f60.tar.zst
nixpkgs-7aae279ad9aacbf09293912939c2ba5795033f60.zip
unstableGitUpdater: fix updating fetchzip-based sources
a67950f20b97a293b2fefeecc349c6b785321e4b added `url` attribute
from `fetchurl` and therefore also from `fetchzip`.
We previously relied on `url` from fetchgit-based fetchers
to find the repo URL but now it will just return tarballs
in the case of `fetchFrom{GitHub,GitLab}`.

Let’s add an attribute to `fetch{git,FromGitHub,FromGitLab}`
to expose a repo URL consistently.
Diffstat (limited to 'pkgs/build-support/fetchgitlab/default.nix')
-rw-r--r--pkgs/build-support/fetchgitlab/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgitlab/default.nix b/pkgs/build-support/fetchgitlab/default.nix
index 5c82a8f8587..264bbcf3f76 100644
--- a/pkgs/build-support/fetchgitlab/default.nix
+++ b/pkgs/build-support/fetchgitlab/default.nix
@@ -15,11 +15,17 @@ let
   useFetchGit = deepClone || fetchSubmodules || leaveDotGit;
   fetcher = if useFetchGit then fetchgit else fetchzip;
 
+  gitRepoUrl = "${protocol}://${domain}/${slug}.git";
+
   fetcherArgs = (if useFetchGit then {
     inherit rev deepClone fetchSubmodules leaveDotGit;
-    url = "${protocol}://${domain}/${slug}.git";
+    url = gitRepoUrl;
   } else {
     url = "${protocol}://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${escapedRev}";
+
+    passthru = {
+      inherit gitRepoUrl;
+    };
   }) // passthruAttrs // { inherit name; };
 in