lib: add fetchFrom9Front

+38
+36
pkgs/build-support/fetch9front/default.nix
··· 1 + { fetchgit, fetchzip, lib }: 2 + 3 + lib.makeOverridable ( 4 + { owner 5 + , repo 6 + , rev 7 + , domain ? "git.9front.org" 8 + , name ? "source" 9 + , leaveDotGit ? false 10 + , deepClone ? false 11 + , ... # For hash agility 12 + } @ args: 13 + 14 + let 15 + passthruAttrs = removeAttrs args [ "domain" "owner" "repo" "rev" "leaveDotGit" "deepClone" ]; 16 + 17 + useFetchGit = leaveDotGit || deepClone; 18 + fetcher = if useFetchGit then fetchgit else fetchzip; 19 + 20 + gitRepoUrl = "git://${domain}/${owner}/${repo}"; 21 + 22 + fetcherArgs = (if useFetchGit then { 23 + # git9 does not support shallow fetches 24 + inherit rev leaveDotGit; 25 + url = gitRepoUrl; 26 + } else { 27 + url = "https://${domain}/${owner}/${repo}/${rev}/snap.tar.gz"; 28 + 29 + passthru = { 30 + inherit gitRepoUrl; 31 + }; 32 + }) // passthruAttrs // { inherit name; }; 33 + in 34 + 35 + fetcher fetcherArgs // { inherit rev; } 36 + )
+2
pkgs/top-level/all-packages.nix
··· 1122 1122 1123 1123 fetchFromGitiles = callPackage ../build-support/fetchgitiles { }; 1124 1124 1125 + fetchFrom9Front = callPackage ../build-support/fetch9front { }; 1126 + 1125 1127 fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz { }; 1126 1128 1127 1129 fetchgx = callPackage ../build-support/fetchgx { };