2021-02-12 16:26:21 +00:00
|
|
|
{
|
|
|
|
lib,
|
2021-04-14 14:22:26 +00:00
|
|
|
stdenv,
|
2021-02-12 16:26:21 +00:00
|
|
|
fetchurl,
|
|
|
|
appimageTools,
|
|
|
|
tor,
|
|
|
|
trezord,
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "trezor-suite";
|
2024-11-30 23:40:53 +00:00
|
|
|
version = "24.11.3";
|
2021-02-12 16:26:21 +00:00
|
|
|
|
2021-04-14 14:22:26 +00:00
|
|
|
suffix =
|
|
|
|
{
|
|
|
|
aarch64-linux = "linux-arm64";
|
|
|
|
x86_64-linux = "linux-x86_64";
|
|
|
|
}
|
|
|
|
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
2021-02-12 16:26:21 +00:00
|
|
|
src = fetchurl {
|
2024-06-29 04:30:58 +00:00
|
|
|
url = "https://github.com/trezor/trezor-suite/releases/download/v${version}/Trezor-Suite-${version}-${suffix}.AppImage";
|
2024-06-28 11:48:43 +00:00
|
|
|
hash =
|
|
|
|
{
|
|
|
|
# curl -Lfs https://github.com/trezor/trezor-suite/releases/download/v${version}/latest-linux{-arm64,}.yml | grep ^sha512 | sed 's/: /-/'
|
2024-11-30 23:40:53 +00:00
|
|
|
aarch64-linux = "sha512-erNWQTaj/WWoqy3TO7wb+ijQkwXjqfCjqvQN6/9gCVjbHswURWHX36P0rJg9vuQu6odi5EKtooDusIxjIUkQzA==";
|
|
|
|
x86_64-linux = "sha512-BorpJI0Vi6fFRGo2lATcuBiI1vTLY8vfmnUXKckJkMCBiurs/ZR08ZxKPOTaoS61BzSanUCRwcovev294bcqkA==";
|
2021-04-14 14:22:26 +00:00
|
|
|
}
|
|
|
|
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
2021-02-12 16:26:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
appimageContents = appimageTools.extractType2 {
|
2024-06-29 04:30:58 +00:00
|
|
|
inherit pname version src;
|
2021-02-12 16:26:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
appimageTools.wrapType2 rec {
|
2024-06-29 04:30:58 +00:00
|
|
|
inherit pname version src;
|
2021-02-12 16:26:21 +00:00
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
mkdir -p $out/bin $out/share/${pname} $out/share/${pname}/resources
|
|
|
|
|
|
|
|
cp -a ${appimageContents}/locales/ $out/share/${pname}
|
|
|
|
cp -a ${appimageContents}/resources/app*.* $out/share/${pname}/resources
|
|
|
|
cp -a ${appimageContents}/resources/images/ $out/share/${pname}/resources
|
|
|
|
|
|
|
|
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
2022-11-11 17:38:38 +00:00
|
|
|
install -m 444 -D ${appimageContents}/resources/images/desktop/512x512.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
2021-04-17 10:38:37 +00:00
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
2024-11-30 23:49:37 +00:00
|
|
|
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
|
2021-02-12 16:26:21 +00:00
|
|
|
|
|
|
|
# symlink system binaries instead bundled ones
|
|
|
|
mkdir -p $out/share/${pname}/resources/bin/{bridge,tor}
|
|
|
|
ln -sf ${trezord}/bin/trezord-go $out/share/${pname}/resources/bin/bridge/trezord
|
|
|
|
ln -sf ${tor}/bin/tor $out/share/${pname}/resources/bin/tor/tor
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Trezor Suite - Desktop App for managing crypto";
|
|
|
|
homepage = "https://suite.trezor.io";
|
2021-06-11 06:58:53 +00:00
|
|
|
changelog = "https://github.com/trezor/trezor-suite/releases/tag/v${version}";
|
2021-02-12 16:26:21 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ prusnak ];
|
2021-04-14 14:22:26 +00:00
|
|
|
platforms = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "trezor-suite";
|
2021-02-12 16:26:21 +00:00
|
|
|
};
|
|
|
|
}
|