Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 24 lines 1.0 kB view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -i bash -p curl common-updater-scripts 3 4set -euo pipefail 5 6reaper_ver=$(curl -Ls https://www.reaper.fm/download.php | grep -o 'Version [0-9]\.[0-9]*' | head -n1 | cut -d' ' -f2) 7 8function set_hash_for_linux() { 9 local arch=$1 10 pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_linux_$arch.tar.xz) 11 pkg_hash=$(nix --extra-experimental-features nix-command hash convert "sha256:$pkg_hash") 12 update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-linux --ignore-same-version 13} 14 15function set_hash_for_darwin() { 16 local arch=$1 17 pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_universal.dmg) 18 pkg_hash=$(nix --extra-experimental-features nix-command hash convert "sha256:$pkg_hash") 19 update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-darwin --ignore-same-version 20} 21 22set_hash_for_linux aarch64 23set_hash_for_linux x86_64 24set_hash_for_darwin aarch64