nixpkgs/pkgs/applications/blockchains/crypto-org-wallet/default.nix
K900 cb2cfba6f7 treewide: switch all desktop file generators to new API
Notably:
- remove explicit arguments that match the defaults
- convert everything to the right Nix types
2022-02-25 13:40:38 -08:00

34 lines
1.2 KiB
Nix

{ lib, fetchurl, appimageTools, imagemagick }:
let
pname = "chain-desktop-wallet";
version = "0.1.1";
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/crypto-com/${pname}/releases/download/v${version}/${name}-x86_64.AppImage";
sha256 = "12076hf8dlz0hg1pb2ixwlslrh8gi6s1iawnvhnn6vz4jmjvq356";
};
appimageContents = appimageTools.extractType2 { inherit name src; };
in appimageTools.wrapType2 rec {
inherit name src;
extraInstallCommands = ''
mv $out/bin/${name} $out/bin/${pname}
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
${imagemagick}/bin/convert ${appimageContents}/${pname}.png -resize 512x512 ${pname}_512.png
install -m 444 -D ${pname}_512.png $out/share/icons/hicolor/512x512/apps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname} %U'
'';
meta = with lib; {
description = "Crypto.org Chain desktop wallet (Beta)";
homepage = "https://github.com/crypto-com/chain-desktop-wallet";
license = licenses.asl20;
maintainers = with maintainers; [ th0rgal ];
platforms = [ "x86_64-linux" ];
};
}