This repository has no description
0

Configure Feed

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

tools.boosteroid: add updateScript for nix-update

+27
+4
tools/boosteroid/package.nix
··· 51 51 in 52 52 buildFHSEnv { 53 53 name = "boosteroid"; 54 + pname = "boosteroid"; 55 + inherit version; 54 56 55 57 targetPkgs = _: [ 56 58 unwrapped ··· 93 95 cd "$dir" 94 96 exec "$dir/Boosteroid" "$@" 95 97 ''; 98 + 99 + passthru.updateScript = ./update.sh; 96 100 97 101 meta = { 98 102 description = "Boosteroid cloud gaming client";
+23
tools/boosteroid/update.sh
··· 1 + #!/usr/bin/env bash 2 + set -euo pipefail 3 + 4 + url="https://boosteroid.com/linux/installer/boosteroid_portable.tar" 5 + pkg="$(dirname "$(realpath "$0")")/package.nix" 6 + 7 + old_hash=$(grep -oP 'hash = "\K[^"]+' "$pkg") 8 + 9 + tmpfile=$(mktemp) 10 + trap 'rm -f "$tmpfile"' EXIT 11 + 12 + curl -fsSL -A "Mozilla/5.0" -o "$tmpfile" "$url" 13 + new_hash=$(nix hash file --sri "$tmpfile") 14 + 15 + if [ "$old_hash" = "$new_hash" ]; then 16 + echo "boosteroid: already up to date ($old_hash)" 17 + exit 0 18 + fi 19 + 20 + echo "boosteroid: updating hash" 21 + echo " old: $old_hash" 22 + echo " new: $new_hash" 23 + sed -i "s|$old_hash|$new_hash|" "$pkg"