plex-pass: update and fix update script
This commit is contained in:
parent
89a9edad15
commit
e5a01e31ba
2 changed files with 17 additions and 10 deletions
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
version = "1.29.0.6244-819d3678c";
|
version = "1.30.1.6497-5fc2e0894";
|
||||||
src = pkgs.fetchurl {
|
src = pkgs.fetchurl {
|
||||||
url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb";
|
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-iGMO6uuNm2c7UBZvA5dYaSxUrEQCL1tR9zLA3rZhBn4=";
|
hash = "sha256:019yyyn24nsn33fvrbg2mqhjp4n710pjdj32xcnlmpq3j6s9w1jp";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
(pkgs.plex.override {
|
(pkgs.plex.override {
|
||||||
|
|
|
@ -3,12 +3,13 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# 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"
|
alias jq="nix run depot.pkgs.jq -c jq"
|
||||||
VERSION_JSON="$(curl "$VERSION_JSON_URL")"
|
VERSION_JSON="$(curl "$VERSION_JSON_URL")"
|
||||||
|
|
||||||
VERSION="$(jq -r '.computer.Linux.version' <<< "$VERSION_JSON")"
|
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="$(jq -r '.url' <<< "$RELEASE_JSON")"
|
||||||
URL_HASH="$(nix-prefetch-url "$URL")"
|
URL_HASH="$(nix-prefetch-url "$URL")"
|
||||||
|
|
||||||
|
@ -18,13 +19,19 @@ cat <<EOF
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
(pkgs.plex.override {
|
let
|
||||||
plexRaw = (pkgs.plexRaw.overrideAttrs (oldAttrs: rec {
|
|
||||||
version = "${VERSION}";
|
version = "${VERSION}";
|
||||||
src = pkgs.fetchurl {
|
src = pkgs.fetchurl {
|
||||||
url = "${URL}";
|
url = "${URL}";
|
||||||
sha256 = "${URL_HASH}";
|
hash = "sha256:${URL_HASH}";
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
(pkgs.plex.override {
|
||||||
|
plexRaw = (pkgs.plexRaw.overrideAttrs (oldAttrs: rec {
|
||||||
|
inherit version src;
|
||||||
}));
|
}));
|
||||||
|
}).overrideAttrs (oldAttrs: {
|
||||||
|
name = "plexmediaserver-\${version}";
|
||||||
|
inherit version src;
|
||||||
})
|
})
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in a new issue