fork/nix-minecraft
git clone https://git.julia.blue/fork/nix-minecraft
e6e6044
lazymc
1{ 2runtimeShell , 3writeShellScriptBin , 4curl , 5jq , 6gnused , 7} : 8writeShellScriptBin "nix-modrinth-prefetch" '' 9input =$( ${ curl } /bin/curl --no-progress-meter https://api.modrinth.com/v2/version/ $ 1 ) 10 11if [[ $ input == "" ]]; then 12echo "Invalid version" 13exit 1 14fi 15 16echo $ input \ 17| ${ jq } /bin/jq -c '.files | (.[] | select(.primary == true)) // .[0] | {url: .url, sha512: .hashes.sha512}' \ 18| ${ gnused } /bin/sed 's/{"url":"\(.\+\)","sha512":"\(.\+\)"}/fetchurl { url = "\1"; sha512 = "\2"; }/' 19''