mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
lib: add fetchFrom9Front
This commit is contained in:
parent
da5286cd2b
commit
db097eb3b5
36
pkgs/build-support/fetch9front/default.nix
Normal file
36
pkgs/build-support/fetch9front/default.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{ fetchgit, fetchzip, lib }:
|
||||
|
||||
lib.makeOverridable (
|
||||
{ owner
|
||||
, repo
|
||||
, rev
|
||||
, domain ? "git.9front.org"
|
||||
, name ? "source"
|
||||
, leaveDotGit ? false
|
||||
, deepClone ? false
|
||||
, ... # For hash agility
|
||||
} @ args:
|
||||
|
||||
let
|
||||
passthruAttrs = removeAttrs args [ "domain" "owner" "repo" "rev" "leaveDotGit" "deepClone" ];
|
||||
|
||||
useFetchGit = leaveDotGit || deepClone;
|
||||
fetcher = if useFetchGit then fetchgit else fetchzip;
|
||||
|
||||
gitRepoUrl = "git://${domain}/${owner}/${repo}";
|
||||
|
||||
fetcherArgs = (if useFetchGit then {
|
||||
# git9 does not support shallow fetches
|
||||
inherit rev leaveDotGit;
|
||||
url = gitRepoUrl;
|
||||
} else {
|
||||
url = "https://${domain}/${owner}/${repo}/${rev}/snap.tar.gz";
|
||||
|
||||
passthru = {
|
||||
inherit gitRepoUrl;
|
||||
};
|
||||
}) // passthruAttrs // { inherit name; };
|
||||
in
|
||||
|
||||
fetcher fetcherArgs // { inherit rev; }
|
||||
)
|
@ -1122,6 +1122,8 @@ with pkgs;
|
||||
|
||||
fetchFromGitiles = callPackage ../build-support/fetchgitiles { };
|
||||
|
||||
fetchFrom9Front = callPackage ../build-support/fetch9front { };
|
||||
|
||||
fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz { };
|
||||
|
||||
fetchgx = callPackage ../build-support/fetchgx { };
|
||||
|
Loading…
Reference in New Issue
Block a user