about summary refs log tree commit diff
path: root/nixpkgs/pkgs/common-updater/git-updater.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/common-updater/git-updater.nix')
-rw-r--r--nixpkgs/pkgs/common-updater/git-updater.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/common-updater/git-updater.nix b/nixpkgs/pkgs/common-updater/git-updater.nix
index 304bad9af60c..b68f4a29011d 100644
--- a/nixpkgs/pkgs/common-updater/git-updater.nix
+++ b/nixpkgs/pkgs/common-updater/git-updater.nix
@@ -1,4 +1,5 @@
-{ genericUpdater
+{ lib
+, genericUpdater
 , common-updater-scripts
 }:
 
@@ -9,9 +10,12 @@
 , rev-prefix ? ""
 , odd-unstable ? false
 , patchlevel-unstable ? false
+# an explicit url is needed when src.meta.homepage or src.url don't
+# point to a git repo (eg. when using fetchurl, fetchzip, ...)
+, url ? null
 }:
 
 genericUpdater {
   inherit pname version attrPath ignoredVersions rev-prefix odd-unstable patchlevel-unstable;
-  versionLister = "${common-updater-scripts}/bin/list-git-tags";
+  versionLister = "${common-updater-scripts}/bin/list-git-tags ${lib.optionalString (url != null) "--url=${url}"}";
 }