Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/build-support/fetchgit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ lib.makeOverridable (lib.fetchers.withNormalizedHash { } (
, # Impure env vars (https://nixos.org/nix/manual/#sec-advanced-attributes)
# needed for netrcPhase
netrcImpureEnvVars ? []
, passthru ? {}
, meta ? {}
, allowedRequisites ? null
}:
Expand Down Expand Up @@ -121,6 +122,6 @@ stdenvNoCC.mkDerivation {
passthru = {
gitRepoUrl = url;
inherit tag;
};
} // passthru;
}
))
24 changes: 18 additions & 6 deletions pkgs/build-support/fetchgithub/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lib.makeOverridable (
, fetchLFS ? false
, sparseCheckout ? []
, githubBase ? "github.com", varPrefix ? null
, passthru ? { }
, meta ? { }
, ... # For hash agility
}@args:
Expand All @@ -26,6 +27,9 @@ let
builtins.unsafeGetAttrPos "rev" args
);
baseUrl = "https://${githubBase}/${owner}/${repo}";
newPassthru = {
inherit owner repo;
} // passthru;
newMeta = meta // {
homepage = meta.homepage or baseUrl;
} // lib.optionalAttrs (position != null) {
Expand Down Expand Up @@ -63,17 +67,25 @@ let

fetcherArgs = (if useFetchGit
then {
inherit tag rev deepClone fetchSubmodules sparseCheckout fetchLFS; url = gitRepoUrl;
inherit tag rev deepClone fetchSubmodules sparseCheckout fetchLFS;
url = gitRepoUrl;
passthru = newPassthru;
} // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; }
else {
url = "${baseUrl}/archive/${revWithTag}.tar.gz";

passthru = {
inherit gitRepoUrl;
};
inherit
gitRepoUrl
tag
;
rev = revWithTag;
} // newPassthru;
}
) // privateAttrs // passthruAttrs // { inherit name; };
) // privateAttrs // passthruAttrs // {
inherit name;
meta = newMeta;
};
in

fetcher fetcherArgs // { meta = newMeta; inherit owner repo tag; rev = revWithTag; }
)
fetcher fetcherArgs)