diff --git a/pkgs/applications/audio/vgmstream/default.nix b/pkgs/applications/audio/vgmstream/default.nix index 221b5b3d4b8c..f696c5061864 100644 --- a/pkgs/applications/audio/vgmstream/default.nix +++ b/pkgs/applications/audio/vgmstream/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { sha256 = "18g1yqlnf48hi2xn2z2wajnjljpdbfdqmcmi7y8hi1r964ypmfcr"; }; + passthru.updateScript = ./update.sh; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ mpg123 ffmpeg libvorbis libao jansson speex ]; diff --git a/pkgs/applications/audio/vgmstream/update.sh b/pkgs/applications/audio/vgmstream/update.sh new file mode 100755 index 000000000000..5353480dd335 --- /dev/null +++ b/pkgs/applications/audio/vgmstream/update.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash --pure --keep GITHUB_TOKEN -p gnused jq nix-prefetch-git curl cacert + +set -euo pipefail + +ROOT="$(dirname "$(readlink -f "$0")")" +if [[ ! "$(basename $ROOT)" == "vgmstream" || ! -f "$ROOT/default.nix" ]]; then + echo "ERROR: Not in the vgmstream folder" + exit 1 +fi + +if [[ ! -v GITHUB_TOKEN ]]; then + echo "ERROR: \$GITHUB_TOKEN not set" + exit 1 +fi + + +payload=$(jq -cn --rawfile query /dev/stdin '{"query": $query}' <