this repo has no description

Compare changes

Choose any two refs to compare.

Changed files
+57 -33
+57 -33
fetcher.nix
··· 9 fetchzip, 10 }: 11 12 - lib.makeOverridable ( 13 { 14 domain ? "tangled.org", 15 owner, ··· 20 # TODO: add back when doing FP 21 # name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "tangled", 22 23 - # fetchgit stuff 24 - fetchSubmodules ? false, 25 - leaveDotGit ? false, 26 - deepClone ? false, 27 - forceFetchGit ? false, 28 - fetchLFS ? false, 29 - sparseCheckout ? [ ], 30 - 31 passthru ? { }, 32 meta ? { }, 33 ... ··· 39 40 let 41 42 position = ( 43 if args.meta.description or null != null then 44 builtins.unsafeGetAttrPos "description" args.meta ··· 60 position = "${position.file}:${toString position.line}"; 61 }; 62 63 - passthruAttrs = removeAttrs args [ 64 - "domain" 65 - "owner" 66 - "repo" 67 - "tag" 68 - "rev" 69 - "fetchSubmodules" 70 - "forceFetchGit" 71 - ]; 72 - 73 - useFetchGit = 74 - fetchSubmodules || leaveDotGit || deepClone || forceFetchGit || fetchLFS || (sparseCheckout != [ ]); 75 76 # We prefer fetchzip in cases we don't need submodules as the hash 77 # is more stable in that case. ··· 89 passthruAttrs 90 // ( 91 if useFetchGit then 92 - { 93 - inherit 94 - tag 95 - rev 96 - deepClone 97 - fetchSubmodules 98 - sparseCheckout 99 - fetchLFS 100 - leaveDotGit 101 - ; 102 url = baseUrl; 103 inherit passthru; 104 derivationArgs = { ··· 139 ) 140 // { 141 name = 142 - args.name 143 - or (repoRevToNameMaybe finalAttrs.repo (lib.revOrTag finalAttrs.revCustom finalAttrs.tag) "github"); 144 meta = newMeta; 145 }; 146 in
··· 9 fetchzip, 10 }: 11 12 + let 13 + 14 + useFetchGitArgsDefault = { 15 + deepClone = false; 16 + fetchSubmodules = false; # This differs from fetchgit's default 17 + fetchLFS = false; 18 + forceFetchGit = false; 19 + leaveDotGit = null; 20 + rootDir = ""; 21 + sparseCheckout = null; 22 + }; 23 + useFetchGitArgsDefaultNullable = { 24 + leaveDotGit = false; 25 + sparseCheckout = [ ]; 26 + }; 27 + useFetchGitargsDefaultNonNull = useFetchGitArgsDefault // useFetchGitArgsDefaultNullable; 28 + excludeUseFetchGitArgNames = [ 29 + "forceFetchGit" 30 + ]; 31 + 32 + faUseFetchGit = lib.mapAttrs (_: _: true) useFetchGitArgsDefault; 33 + 34 + adjustFunctionArgs = f: lib.setFunctionArgs f (faUseFetchGit // lib.functionArgs f); 35 + 36 + decorate = f: lib.makeOverridable (adjustFunctionArgs f); 37 + 38 + in 39 + 40 + decorate ( 41 { 42 domain ? "tangled.org", 43 owner, ··· 48 # TODO: add back when doing FP 49 # name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "tangled", 50 51 passthru ? { }, 52 meta ? { }, 53 ... ··· 59 60 let 61 62 + useFetchGit = 63 + lib.mapAttrs ( 64 + name: nonNullDefault: 65 + if args ? ${name} && (useFetchGitArgsDefaultNullable ? ${name} -> args.${name} != null) then 66 + args.${name} 67 + else 68 + nonNullDefault 69 + ) useFetchGitargsDefaultNonNull != useFetchGitargsDefaultNonNull; 70 + useFetchGitArgsWDPassing = lib.overrideExisting (removeAttrs useFetchGitArgsDefault excludeUseFetchGitArgNames) args; 71 + 72 position = ( 73 if args.meta.description or null != null then 74 builtins.unsafeGetAttrPos "description" args.meta ··· 90 position = "${position.file}:${toString position.line}"; 91 }; 92 93 + passthruAttrs = removeAttrs args ( 94 + [ 95 + "domain" 96 + "owner" 97 + "repo" 98 + "tag" 99 + "rev" 100 + "fetchSubmodules" 101 + "forceFetchGit" 102 + ] 103 + ++ (if useFetchGit then excludeUseFetchGitArgNames else lib.attrNames faUseFetchGit) 104 + ); 105 106 # We prefer fetchzip in cases we don't need submodules as the hash 107 # is more stable in that case. ··· 119 passthruAttrs 120 // ( 121 if useFetchGit then 122 + useFetchGitArgsWDPassing 123 + // { 124 + inherit tag rev; 125 url = baseUrl; 126 inherit passthru; 127 derivationArgs = { ··· 162 ) 163 // { 164 name = 165 + args.name or (repoRevToNameMaybe finalAttrs.repo (lib.revOrTag finalAttrs.revCustom finalAttrs.tag) 166 + "tangled" 167 + ); 168 meta = newMeta; 169 }; 170 in