From e5a01e31ba5d8e118800c4f0746fba3fc3bff609 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 8 Jan 2023 05:44:03 +0000 Subject: [PATCH] plex-pass: update and fix update script --- nix/pkgs/plex-pass.nix | 6 +++--- nix/pkgs/updateplexpass.sh | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/nix/pkgs/plex-pass.nix b/nix/pkgs/plex-pass.nix index d149095bb1..11b714e94f 100644 --- a/nix/pkgs/plex-pass.nix +++ b/nix/pkgs/plex-pass.nix @@ -4,10 +4,10 @@ { pkgs, ... }: let - version = "1.29.0.6244-819d3678c"; + version = "1.30.1.6497-5fc2e0894"; src = pkgs.fetchurl { - url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb"; - hash = "sha256-iGMO6uuNm2c7UBZvA5dYaSxUrEQCL1tR9zLA3rZhBn4="; + url = "https://downloads.plex.tv/plex-media-server-new/1.30.1.6497-5fc2e0894/debian/plexmediaserver_1.30.1.6497-5fc2e0894_amd64.deb"; + hash = "sha256:019yyyn24nsn33fvrbg2mqhjp4n710pjdj32xcnlmpq3j6s9w1jp"; }; in (pkgs.plex.override { diff --git a/nix/pkgs/updateplexpass.sh b/nix/pkgs/updateplexpass.sh index 8a7d9885e9..a29335922e 100755 --- a/nix/pkgs/updateplexpass.sh +++ b/nix/pkgs/updateplexpass.sh @@ -3,12 +3,13 @@ # # SPDX-License-Identifier: Apache-2.0 -VERSION_JSON_URL="https://plex.tv/pms/downloads/5.json?channel=plexpass&X-Plex-Token=$(vault kv get -field=token kv/apps/plex-pass)" +[ -z "$PLEX_PASS_TOKEN" ] && PLEX_PASS_TOKEN="$(vault kv get -field=token kv/apps/plex-pass)" +VERSION_JSON_URL="https://plex.tv/pms/downloads/5.json?channel=plexpass&X-Plex-Token=${PLEX_PASS_TOKEN}" alias jq="nix run depot.pkgs.jq -c jq" VERSION_JSON="$(curl "$VERSION_JSON_URL")" VERSION="$(jq -r '.computer.Linux.version' <<< "$VERSION_JSON")" -RELEASE_JSON="$(jq '.computer.Linux.releases[] | select(.build == "linux-x86_64" and .distro == "redhat")' <<< "$VERSION_JSON")" +RELEASE_JSON="$(jq '.computer.Linux.releases[] | select(.build == "linux-x86_64" and .distro == "debian")' <<< "$VERSION_JSON")" URL="$(jq -r '.url' <<< "$RELEASE_JSON")" URL_HASH="$(nix-prefetch-url "$URL")" @@ -18,13 +19,19 @@ cat <