this repo has no description
1# this is really just a fork of fetchFromGitHub, but with a few changes due to
2# incompatibilities. furthermore, there is no such concept of private in
3# atproto, so all the private stuff has been removed.
4
5{
6 lib,
7 fetchFromGitProvider,
8}:
9
10lib.makeOverridable (
11 lib.extendMkDerivation {
12 constructDrv = fetchFromGitProvider;
13
14 excludeDrvArgNames = [
15 "domain"
16 "owner"
17
18 "useFetchGit"
19 ];
20
21 extendDrvArgs =
22 finalAttrs:
23 {
24 domain ? "tangled.org",
25 owner,
26 repo,
27 rev ? null,
28 tag ? null,
29 passthru ? { },
30 meta ? { },
31 ...
32 }@args:
33
34 let
35
36 position = (
37 if args.meta.description or null != null then
38 builtins.unsafeGetAttrPos "description" args.meta
39 else if tag != null then
40 builtins.unsafeGetAttrPos "tag" args
41 else
42 builtins.unsafeGetAttrPos "rev" args
43 );
44
45 baseUrl = "https://${domain}/${owner}/${repo}";
46
47 newMeta =
48 meta
49 // {
50 homepage = meta.homepage or baseUrl;
51 }
52 // lib.optionalAttrs (position != null) {
53 # to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
54 position = "${position.file}:${toString position.line}";
55 };
56
57 in
58
59 {
60 providerName = "tangled";
61
62 derivationArgs = {
63 inherit
64 domain
65 owner
66 ;
67 };
68
69 inherit repo;
70
71 gitRepoUrl = baseUrl;
72
73 fetchZipArgs =
74 let
75 revWithTag = finalAttrs.rev;
76 in
77 {
78 url = "${baseUrl}/archive/${revWithTag}";
79 extension = "tar.gz";
80 };
81
82 meta = newMeta;
83 };
84 }
85)