mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-18 02:05:51 +03:00
sunshine: add updater script
This commit is contained in:
parent
8c57d13c13
commit
42ca62eb01
@ -153,6 +153,8 @@ stdenv.mkDerivation rec {
|
||||
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]}
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./updater.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Sunshine is a Game stream host for Moonlight.";
|
||||
homepage = "https://github.com/LizardByte/Sunshine";
|
||||
|
23
pkgs/servers/sunshine/updater.sh
Executable file
23
pkgs/servers/sunshine/updater.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p gnugrep gnused coreutils curl wget jq nix-update prefetch-npm-deps nodejs
|
||||
|
||||
set -euo pipefail
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
version=$(curl -s "https://api.github.com/repos/LizardByte/sunshine/tags" | jq -r .[0].name | grep -oP "^v\K.*")
|
||||
url="https://raw.githubusercontent.com/LizardByte/sunshine/v$version/"
|
||||
|
||||
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
|
||||
echo "Already up to date!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
rm -f package-lock.json package.json
|
||||
wget "$url/package.json"
|
||||
npm i --package-lock-only
|
||||
npm_hash=$(prefetch-npm-deps package-lock.json)
|
||||
sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' default.nix
|
||||
rm -f package.json
|
||||
|
||||
popd
|
||||
nix-update sunshine --version $version
|
Loading…
Reference in New Issue
Block a user