diff --git a/pkgs/build-support/fetchbitbucket/default.nix b/pkgs/build-support/fetchbitbucket/default.nix index e6e40c4379bb..2f9103f2bb3e 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 1f7947d4d452..43a10c3aa552 100644 --- a/pkgs/build-support/fetchcvs/default.nix +++ b/pkgs/build-support/fetchcvs/default.nix @@ -3,8 +3,9 @@ # tag="" (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 ae38edee4fdf..9ab57d5c05ea 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 56973f5d3678..beabe30c35a7 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 79804588cfe5..513ceba861cb 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 b1a85e9f691b..fc09c211b426 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 827680992d69..be81c6e8a4c2 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 5cdd04fc46ce..146845e06a71 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 fa1945775537..02a77b25ae06 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 994922a58679..e75e25fc1e70 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 d111e96885c0..983b5683eb1c 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}"; } +)