tangled
alpha
login
or
join now
isabelroses.com
/
fetch-tangled
21
fork
atom
this repo has no description
21
fork
atom
overview
issues
pulls
1
pipelines
feat: support tag fetching
isabelroses.com
6 months ago
6c593e6a
482fb626
+13
-2
1 changed file
expand all
collapse all
unified
split
fetcher.nix
+13
-2
fetcher.nix
···
20
owner,
21
repo,
22
rev ? null,
23
-
name ? repoRevToNameMaybe repo rev "tangled",
0
24
25
# fetchgit stuff
26
fetchSubmodules ? false,
···
34
...
35
}@args:
36
0
0
0
0
37
let
38
39
position = (
40
if args.meta.description or null != null then
41
builtins.unsafeGetAttrPos "description" args.meta
0
0
42
else
43
builtins.unsafeGetAttrPos "rev" args
44
);
···
59
"domain"
60
"owner"
61
"repo"
0
62
"rev"
63
"fetchSubmodules"
64
"forceFetchGit"
···
77
fetchzip.override { withUnzip = false; }
78
else
79
fetchzip;
0
0
80
81
fetcherArgs =
82
(
83
if useFetchGit then
84
{
85
inherit
0
86
rev
87
deepClone
88
fetchSubmodules
···
94
}
95
else
96
{
97
-
url = "${baseUrl}/archive/${rev}";
98
extension = "tar.gz";
99
100
passthru = {
···
20
owner,
21
repo,
22
rev ? null,
23
+
tag ? null,
24
+
name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "tangled",
25
26
# fetchgit stuff
27
fetchSubmodules ? false,
···
35
...
36
}@args:
37
38
+
assert lib.assertMsg (lib.xor (tag != null) (
39
+
rev != null
40
+
)) "fetchFromTangled requires one of either `rev` or `tag` to be provided (not both).";
41
+
42
let
43
44
position = (
45
if args.meta.description or null != null then
46
builtins.unsafeGetAttrPos "description" args.meta
47
+
else if tag != null then
48
+
builtins.unsafeGetAttrPos "tag" args
49
else
50
builtins.unsafeGetAttrPos "rev" args
51
);
···
66
"domain"
67
"owner"
68
"repo"
69
+
"tag"
70
"rev"
71
"fetchSubmodules"
72
"forceFetchGit"
···
85
fetchzip.override { withUnzip = false; }
86
else
87
fetchzip;
88
+
89
+
revWithTag = if tag != null then "refs%2Ftags%2F${tag}" else rev;
90
91
fetcherArgs =
92
(
93
if useFetchGit then
94
{
95
inherit
96
+
tag
97
rev
98
deepClone
99
fetchSubmodules
···
105
}
106
else
107
{
108
+
url = "${baseUrl}/archive/${revWithTag}";
109
extension = "tar.gz";
110
111
passthru = {