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