diff options
author | piegames <git@piegames.de> | 2022-02-10 14:40:58 +0100 |
---|---|---|
committer | piegames <git@piegames.de> | 2023-04-22 22:29:23 +0200 |
commit | a205795c8a8be87904dc687ea64c271848dc8af0 (patch) | |
tree | 275f903572957c16e84fa55ba14b25b4cbef9e16 /pkgs/build-support | |
parent | 60d3ce948ee94d2066547226fbb07e6898b7b84c (diff) |
treewide: Make some fetchers overridable
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/fetchbitbucket/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/fetchcvs/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/fetchdarcs/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/fetchgit/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/fetchgitea/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/fetchgithub/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/fetchgitiles/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/fetchgitlab/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/fetchgitlocal/default.nix | 6 | ||||
-rw-r--r-- | pkgs/build-support/fetchsavannah/default.nix | 4 | ||||
-rw-r--r-- | pkgs/build-support/fetchsourcehut/default.nix | 2 |
11 files changed, 29 insertions, 5 deletions
diff --git a/pkgs/build-support/fetchbitbucket/default.nix b/pkgs/build-support/fetchbitbucket/default.nix index e6e40c4379bb0..2f9103f2bb3e0 100644 --- a/pkgs/build-support/fetchbitbucket/default.nix +++ b/pkgs/build-support/fetchbitbucket/default.nix @@ -1,5 +1,6 @@ -{ fetchzip }: +{ fetchzip, lib }: +lib.makeOverridable ( { owner, repo, rev, name ? "source" , ... # For hash agility }@args: fetchzip ({ @@ -7,3 +8,4 @@ url = "https://bitbucket.org/${owner}/${repo}/get/${rev}.tar.gz"; meta.homepage = "https://bitbucket.org/${owner}/${repo}/"; } // removeAttrs args [ "owner" "repo" "rev" ]) // { inherit rev; } +) diff --git a/pkgs/build-support/fetchcvs/default.nix b/pkgs/build-support/fetchcvs/default.nix index 1f7947d4d4529..43a10c3aa5529 100644 --- a/pkgs/build-support/fetchcvs/default.nix +++ b/pkgs/build-support/fetchcvs/default.nix @@ -3,8 +3,9 @@ # tag="<tagname>" (get version by tag name) # If you don't specify neither one date="NOW" will be used (get latest) -{stdenvNoCC, cvs, openssh}: +{stdenvNoCC, cvs, openssh, lib}: +lib.makeOverridable ( {cvsRoot, module, tag ? null, date ? null, sha256}: stdenvNoCC.mkDerivation { @@ -18,3 +19,4 @@ stdenvNoCC.mkDerivation { inherit cvsRoot module sha256 tag date; } +) diff --git a/pkgs/build-support/fetchdarcs/default.nix b/pkgs/build-support/fetchdarcs/default.nix index ae38edee4fdf7..9ab57d5c05ea5 100644 --- a/pkgs/build-support/fetchdarcs/default.nix +++ b/pkgs/build-support/fetchdarcs/default.nix @@ -1,5 +1,6 @@ -{stdenvNoCC, darcs, cacert}: +{stdenvNoCC, darcs, cacert, lib}: +lib.makeOverridable ( { url , rev ? null , context ? null @@ -21,3 +22,4 @@ stdenvNoCC.mkDerivation { inherit url rev context name; } +) diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 56973f5d3678a..beabe30c35a72 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -10,6 +10,7 @@ appendShort = lib.optionalString ((builtins.match "[a-f0-9]*" rev) != null) "-${short}"; in "${if matched == null then base else builtins.head matched}${appendShort}"; in +lib.makeOverridable ( { url, rev ? "HEAD", md5 ? "", sha256 ? "", hash ? "", leaveDotGit ? deepClone , fetchSubmodules ? true, deepClone ? false , branchName ? null @@ -107,3 +108,4 @@ stdenvNoCC.mkDerivation { gitRepoUrl = url; }; } +) diff --git a/pkgs/build-support/fetchgitea/default.nix b/pkgs/build-support/fetchgitea/default.nix index 79804588cfe5a..513ceba861cbb 100644 --- a/pkgs/build-support/fetchgitea/default.nix +++ b/pkgs/build-support/fetchgitea/default.nix @@ -2,6 +2,8 @@ { lib, fetchFromGitHub }: +lib.makeOverridable ( { domain, ... }@args: fetchFromGitHub ((removeAttrs args [ "domain" ]) // { githubBase = domain; }) +) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index b1a85e9f691bc..fc09c211b4268 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -1,5 +1,6 @@ { lib, fetchgit, fetchzip }: +lib.makeOverridable ( { owner, repo, rev, name ? "source" , fetchSubmodules ? false, leaveDotGit ? null , deepClone ? false, private ? false, forceFetchGit ? false @@ -60,3 +61,4 @@ let in fetcher fetcherArgs // { meta = newMeta; inherit rev owner repo; } +) diff --git a/pkgs/build-support/fetchgitiles/default.nix b/pkgs/build-support/fetchgitiles/default.nix index 827680992d69d..be81c6e8a4c21 100644 --- a/pkgs/build-support/fetchgitiles/default.nix +++ b/pkgs/build-support/fetchgitiles/default.nix @@ -1,5 +1,6 @@ { fetchzip, lib }: +lib.makeOverridable ( { url, rev, name ? "source", ... } @ args: fetchzip ({ @@ -8,3 +9,4 @@ fetchzip ({ stripRoot = false; meta.homepage = url; } // removeAttrs args [ "url" "rev" ]) // { inherit rev; } +) diff --git a/pkgs/build-support/fetchgitlab/default.nix b/pkgs/build-support/fetchgitlab/default.nix index 5cdd04fc46ce8..146845e06a71c 100644 --- a/pkgs/build-support/fetchgitlab/default.nix +++ b/pkgs/build-support/fetchgitlab/default.nix @@ -1,5 +1,6 @@ { fetchgit, fetchzip, lib }: +lib.makeOverridable ( # gitlab example { owner, repo, rev, protocol ? "https", domain ? "gitlab.com", name ? "source", group ? null , fetchSubmodules ? false, leaveDotGit ? false, deepClone ? false @@ -30,3 +31,4 @@ let in fetcher fetcherArgs // { meta.homepage = "${protocol}://${domain}/${slug}/"; inherit rev; } +) diff --git a/pkgs/build-support/fetchgitlocal/default.nix b/pkgs/build-support/fetchgitlocal/default.nix index fa19457755374..02a77b25ae068 100644 --- a/pkgs/build-support/fetchgitlocal/default.nix +++ b/pkgs/build-support/fetchgitlocal/default.nix @@ -1,4 +1,7 @@ -{ runCommand, git }: src: +{ runCommand, git, lib }: + +lib.makeOverridable ( +src: let srcStr = toString src; @@ -38,3 +41,4 @@ let ''; in nixPath +) diff --git a/pkgs/build-support/fetchsavannah/default.nix b/pkgs/build-support/fetchsavannah/default.nix index 994922a58679d..e75e25fc1e70b 100644 --- a/pkgs/build-support/fetchsavannah/default.nix +++ b/pkgs/build-support/fetchsavannah/default.nix @@ -1,5 +1,6 @@ -{ fetchzip }: +{ fetchzip, lib }: +lib.makeOverridable ( # cgit example, snapshot support is optional in cgit { repo, rev, name ? "source" , ... # For hash agility @@ -8,3 +9,4 @@ url = "https://git.savannah.gnu.org/cgit/${repo}.git/snapshot/${repo}-${rev}.tar.gz"; meta.homepage = "https://git.savannah.gnu.org/cgit/${repo}.git/"; } // removeAttrs args [ "repo" "rev" ]) // { inherit rev; } +) diff --git a/pkgs/build-support/fetchsourcehut/default.nix b/pkgs/build-support/fetchsourcehut/default.nix index d111e96885c06..983b5683eb1c9 100644 --- a/pkgs/build-support/fetchsourcehut/default.nix +++ b/pkgs/build-support/fetchsourcehut/default.nix @@ -1,5 +1,6 @@ { fetchgit, fetchhg, fetchzip, lib }: +lib.makeOverridable ( { owner , repo, rev , domain ? "sr.ht" @@ -48,3 +49,4 @@ in cases.${fetcher}.fetch cases.${fetcher}.arguments // { inherit rev; meta.homepage = "${baseUrl}"; } +) |