tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
lib: add fetchFrom9Front
Jacob Moody
2 years ago
db097eb3
da5286cd
+38
2 changed files
expand all
collapse all
unified
split
pkgs
build-support
fetch9front
default.nix
top-level
all-packages.nix
+36
pkgs/build-support/fetch9front/default.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
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
1123
fetchFromGitiles = callPackage ../build-support/fetchgitiles { };
1124
0
0
1125
fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz { };
1126
1127
fetchgx = callPackage ../build-support/fetchgx { };
···
1122
1123
fetchFromGitiles = callPackage ../build-support/fetchgitiles { };
1124
1125
+
fetchFrom9Front = callPackage ../build-support/fetch9front { };
1126
+
1127
fetchFromRepoOrCz = callPackage ../build-support/fetchrepoorcz { };
1128
1129
fetchgx = callPackage ../build-support/fetchgx { };