lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 24.05-pre 40 lines 899 B view raw
1{ lib 2, runCommandLocal 3, buildPlatform 4, xrootd 5}: 6 7{ name ? "" 8, pname ? "" 9, version ? "" 10, urls ? [ ] 11, url ? if urls == [ ] then abort "Expect either non-empty `urls` or `url`" else builtins.head urls 12, hash ? lib.fakeHash 13}: 14 15(runCommandLocal name 16 { 17 nativeBuildInputs = [ xrootd ]; 18 outputHashAlgo = null; 19 outputHashMode = "flat"; 20 outputHash = hash; 21 inherit url; 22 urls = if urls == [ ] then lib.singleton url else urls; 23 } 24 '' 25 for u in $urls; do 26 xrdcp --verbose --force "$u" "$out" 27 ret=$? 28 (( ret != 0 )) || break 29 done 30 if (( ret )); then 31 echo "xrdcp failed trying to download any of the urls" >&2 32 exit $ret 33 fi 34 '').overrideAttrs (finalAttrs: 35if (pname != "" && version != "") then { 36 inherit pname version; 37 name = "${pname}-${version}"; 38} else { 39 name = if (name != "") then name else (baseNameOf finalAttrs.url); 40})