1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00
nixpkgs/pkgs/by-name/cr/crypto-org-wallet/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

33 lines
1.2 KiB
Nix

{ lib, fetchurl, appimageTools, imagemagick }:
let
pname = "chain-desktop-wallet";
version = "0.1.1";
src = fetchurl {
url = "https://github.com/crypto-com/${pname}/releases/download/v${version}/${pname}-${version}-x86_64.AppImage";
sha256 = "12076hf8dlz0hg1pb2ixwlslrh8gi6s1iawnvhnn6vz4jmjvq356";
};
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in appimageTools.wrapType2 rec {
inherit pname version src;
extraInstallCommands = ''
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" ];
mainProgram = "chain-desktop-wallet";
};
}