summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-05-25 23:52:26 +0200
committerGitHub <noreply@github.com>2022-05-25 23:52:26 +0200
commit9f8610e5dbb0b437b4f4ac9d65057cf7553218f2 (patch)
tree963e63aa79f513b44bde2b368fef34c8ce518a90
parenta96cc0414afecb773fad7c3c9558c13a15196c98 (diff)
parent7aae279ad9aacbf09293912939c2ba5795033f60 (diff)
Merge pull request #174291 from jtojnar/unstable-updater-url
-rw-r--r--pkgs/build-support/fetchgit/default.nix4
-rw-r--r--pkgs/build-support/fetchgithub/default.nix13
-rw-r--r--pkgs/build-support/fetchgitlab/default.nix8
-rw-r--r--pkgs/common-updater/unstable-updater.nix2
4 files changed, 23 insertions, 4 deletions
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix
index b0cc42f07145..2ae1714e4af0 100644
--- a/pkgs/build-support/fetchgit/default.nix
+++ b/pkgs/build-support/fetchgit/default.nix
@@ -92,4 +92,8 @@ stdenvNoCC.mkDerivation {
];
inherit preferLocalBuild meta;
+
+ passthru = {
+ gitRepoUrl = url;
+ };
}
diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix
index 27cb8312ea0a..cfb6a6ca7cd8 100644
--- a/pkgs/build-support/fetchgithub/default.nix
+++ b/pkgs/build-support/fetchgithub/default.nix
@@ -42,11 +42,20 @@ let
'';
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
};
+
+ gitRepoUrl = "${baseUrl}.git";
+
fetcherArgs = (if useFetchGit
then {
- inherit rev deepClone fetchSubmodules sparseCheckout; url = "${baseUrl}.git";
+ inherit rev deepClone fetchSubmodules sparseCheckout; url = gitRepoUrl;
} // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; }
- else { url = "${baseUrl}/archive/${rev}.tar.gz"; }
+ else {
+ url = "${baseUrl}/archive/${rev}.tar.gz";
+
+ passthru = {
+ inherit gitRepoUrl;
+ };
+ }
) // privateAttrs // passthruAttrs // { inherit name; };
in
diff --git a/pkgs/build-support/fetchgitlab/default.nix b/pkgs/build-support/fetchgitlab/default.nix
index 5c82a8f8587d..264bbcf3f761 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
diff --git a/pkgs/common-updater/unstable-updater.nix b/pkgs/common-updater/unstable-updater.nix
index 14f25a91601c..2be065f410e7 100644
--- a/pkgs/common-updater/unstable-updater.nix
+++ b/pkgs/common-updater/unstable-updater.nix
@@ -49,7 +49,7 @@ let
# By default we set url to src.url
if [[ -z "$url" ]]; then
url="$(${nix}/bin/nix-instantiate $systemArg --eval -E \
- "with import ./. {}; $UPDATE_NIX_ATTR_PATH.src.url or $UPDATE_NIX_ATTR_PATH.src.meta.homepage" \
+ "with import ./. {}; $UPDATE_NIX_ATTR_PATH.src.gitRepoUrl" \
| tr -d '"')"
fi