trezor-suite: add updateScript
This commit is contained in:
@@ -62,6 +62,8 @@ appimageTools.wrapType2 rec {
|
||||
ln -sf ${tor}/bin/tor $out/share/${pname}/resources/bin/tor/tor
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Trezor Suite - Desktop App for managing crypto";
|
||||
homepage = "https://suite.trezor.io";
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl yq
|
||||
set -eu -o pipefail
|
||||
|
||||
target="$(dirname "$(readlink -f "$0")")/package.nix"
|
||||
host="https://data.trezor.io"
|
||||
metadata_aarch64=$(curl "$host/suite/releases/desktop/latest/latest-linux-arm64.yml")
|
||||
metadata_x64=$(curl "$host/suite/releases/desktop/latest/latest-linux.yml")
|
||||
hash_aarch64=$(echo "$metadata_aarch64" | yq .sha512 -r)
|
||||
hash_x64=$(echo "$metadata_x64" | yq .sha512 -r)
|
||||
version=$(echo "$metadata_x64" | yq .version -r)
|
||||
|
||||
sed -i "s@version = .*;@version = \"$version\";@g" "$target"
|
||||
sed -i "s@aarch64-linux = \"sha512.*@aarch64-linux = \"sha512-$hash_aarch64\";@" "$target"
|
||||
sed -i "s@x86_64-linux = \"sha512.*@x86_64-linux = \"sha512-$hash_x64\";@" "$target"
|
||||
Reference in New Issue
Block a user