2021-02-13 14:23:35 +00:00
|
|
|
{ lib
|
2021-05-03 20:48:10 +00:00
|
|
|
, stdenv
|
2021-02-13 14:23:35 +00:00
|
|
|
, fetchurl
|
|
|
|
, appimageTools
|
|
|
|
, tor
|
|
|
|
, trezord
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "trezor-suite";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "21.6.1";
|
2021-02-13 14:23:35 +00:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
2021-05-03 20:48:10 +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-13 14:23:35 +00:00
|
|
|
src = fetchurl {
|
2021-05-03 20:48:10 +00:00
|
|
|
url = "https://github.com/trezor/${pname}/releases/download/v${version}/Trezor-Suite-${version}-${suffix}.AppImage";
|
2021-05-20 23:08:51 +00:00
|
|
|
# sha512 hashes are obtained from latest-linux-arm64.yml and latest-linux.yml
|
|
|
|
sha512 = {
|
2021-06-28 23:13:55 +00:00
|
|
|
aarch64-linux = "sha512-IxWiOJEk2PHdKf4QPHH9Y5rdyhKF3aQCHJe1crS4sYrE+4BLj3rFwRPIIGhJLqzqPyW24Hw/A4lnRnDd/UpsNA==";
|
|
|
|
x86_64-linux = "sha512-pSJ+4y9v1ltXun3F4UyQoSTJdaFSelIHx49DBbd180MSbpETecVa7OFadKjlSUKD1sknNXG9MDb2hv7SRNdDYw==";
|
2021-05-03 20:48:10 +00:00
|
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
|
|
inherit name src;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
appimageTools.wrapType2 rec {
|
|
|
|
inherit name src;
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
mv $out/bin/${name} $out/bin/${pname}
|
|
|
|
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
|
|
|
|
install -m 444 -D ${appimageContents}/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
|
|
|
install -m 444 -D ${appimageContents}/resources/images/icons/512x512.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
2021-04-18 02:13:31 +00:00
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
2021-07-03 03:11:41 +00:00
|
|
|
--replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
|
2021-02-13 14:23:35 +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-28 23:13:55 +00:00
|
|
|
changelog = "https://github.com/trezor/trezor-suite/releases/tag/v${version}";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ prusnak ];
|
2021-05-03 20:48:10 +00:00
|
|
|
platforms = [ "aarch64-linux" "x86_64-linux" ];
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
}
|