trezor-suite: wayland; autoupdate; 24.12.3 -> 25.2.2 (#384827)
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
stdenv,
|
||||
fetchurl,
|
||||
appimageTools,
|
||||
makeWrapper,
|
||||
tor,
|
||||
trezord,
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "trezor-suite";
|
||||
version = "24.12.3";
|
||||
version = "25.2.2";
|
||||
|
||||
suffix =
|
||||
{
|
||||
@@ -23,13 +24,13 @@ let
|
||||
hash =
|
||||
{
|
||||
# curl -Lfs https://github.com/trezor/trezor-suite/releases/download/v${version}/latest-linux{-arm64,}.yml | grep ^sha512 | sed 's/: /-/'
|
||||
aarch64-linux = "sha512-erNWQTaj/WWoqy3TO7wb+ijQkwXjqfCjqvQN6/9gCVjbHswURWHX36P0rJg9vuQu6odi5EKtooDusIxjIUkQzA==";
|
||||
x86_64-linux = "sha512-Zd+Ou3YUymlKr5lOTdWEZVdCbz3cIJx3Ho65AGDUXkNXfOrCc0v9faE8Np/9TkpJDWWqjjUoTJkkvsbapiMOOQ==";
|
||||
aarch64-linux = "sha512-9EWbYju0e3DdS8bnuMiD4Cdodz/LxbLyCItNEWSIi/UADxtH7smAbpAu4Awcgbb3o39x94Mf8rbqcxmIktDDhQ==";
|
||||
x86_64-linux = "sha512-j8TI46Jr/Tc99Ri3aFY0z73HFY5AWpeAv/yJy8xsV8rNGWEwKlCvJzkrEUpvpFUBMoHgGw3PTQ7CYUQ5bmB/CA==";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extractType2 {
|
||||
appimageContents = appimageTools.extract {
|
||||
inherit pname version src;
|
||||
};
|
||||
|
||||
@@ -38,6 +39,8 @@ in
|
||||
appimageTools.wrapType2 rec {
|
||||
inherit pname version src;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir -p $out/bin $out/share/${pname} $out/share/${pname}/resources
|
||||
|
||||
@@ -45,6 +48,9 @@ appimageTools.wrapType2 rec {
|
||||
cp -a ${appimageContents}/resources/app*.* $out/share/${pname}/resources
|
||||
cp -a ${appimageContents}/resources/images/ $out/share/${pname}/resources
|
||||
|
||||
wrapProgram $out/bin/trezor-suite \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
|
||||
|
||||
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||
install -m 444 -D ${appimageContents}/resources/images/desktop/512x512.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
||||
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||
@@ -56,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