···
19
-
domain ? "tangled.sh",
24
-
name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "tangled",
27
-
fetchSubmodules ? false,
28
-
leaveDotGit ? false,
30
-
forceFetchGit ? false,
32
-
sparseCheckout ? [ ],
38
-
assert lib.assertMsg (lib.xor (tag != null) (
40
-
)) "fetchFromTangled requires one of either `rev` or `tag` to be provided (not both).";
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
50
-
builtins.unsafeGetAttrPos "rev" args
53
-
baseUrl = "https://${domain}/${owner}/${repo}";
58
-
homepage = meta.homepage or baseUrl;
60
-
// lib.optionalAttrs (position != null) {
61
-
# to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
62
-
position = "${position.file}:${toString position.line}";
19
+
lib.extendMkDerivation {
20
+
constructDrv = stdenvNoCC.mkDerivation;
22
+
excludeDrvArgNames = [
23
+
# Additional stdenv.mkDerivation arguments from derived fetchers.
65
-
passthruAttrs = removeAttrs args [
76
-
fetchSubmodules || leaveDotGit || deepClone || forceFetchGit || fetchLFS || (sparseCheckout != [ ]);
78
-
# We prefer fetchzip in cases we don't need submodules as the hash
79
-
# is more stable in that case.
83
-
# fetchzip may not be overridable when using external tools, for example nix-prefetch
84
-
else if fetchzip ? override then
85
-
fetchzip.override { withUnzip = false; }
89
-
revWithTag = if tag != null then "refs%2Ftags%2F${tag}" else rev;
32
+
domain ? "tangled.sh",
37
+
name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "tangled",
40
+
fetchSubmodules ? false,
41
+
leaveDotGit ? false,
43
+
forceFetchGit ? false,
45
+
sparseCheckout ? [ ],
51
+
assert lib.assertMsg (lib.xor (tag != null) (
53
+
)) "fetchFromTangled requires one of either `rev` or `tag` to be provided (not both).";
58
+
if args.meta.description or null != null then
59
+
builtins.unsafeGetAttrPos "description" args.meta
60
+
else if tag != null then
61
+
builtins.unsafeGetAttrPos "tag" args
63
+
builtins.unsafeGetAttrPos "rev" args
66
+
baseUrl = "https://${domain}/${owner}/${repo}";
71
+
homepage = meta.homepage or baseUrl;
108
-
url = "${baseUrl}/archive/${revWithTag}";
109
-
extension = "tar.gz";
112
-
gitRepoUrl = baseUrl;
73
+
// lib.optionalAttrs (position != null) {
74
+
# to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
75
+
position = "${position.file}:${toString position.line}";
78
+
passthruAttrs = removeAttrs args [
89
+
fetchSubmodules || leaveDotGit || deepClone || forceFetchGit || fetchLFS || (sparseCheckout != [ ]);
91
+
# We prefer fetchzip in cases we don't need submodules as the hash
92
+
# is more stable in that case.
96
+
# fetchzip may not be overridable when using external tools, for example nix-prefetch
97
+
else if fetchzip ? override then
98
+
fetchzip.override { withUnzip = false; }
102
+
revWithTag = if tag != null then "refs%2Ftags%2F${tag}" else rev;
106
+
if useFetchGit then
121
+
url = "${baseUrl}/archive/${revWithTag}";
122
+
extension = "tar.gz";
125
+
gitRepoUrl = baseUrl;
135
+
fetcher fetcherArgs
138
+
inherit owner repo tag;
122
-
fetcher fetcherArgs
125
-
inherit owner repo tag;