{
  lib,
  appimageTools,
  fetchurl,
}: let
  pname = "feishin";
  version = "0.5.3";
  src = fetchurl {
    url = "https://github.com/jeffvli/feishin/releases/download/v${version}/Feishin-${version}-linux-x86_64.AppImage";
    hash = "sha256-1JlsEBLVBaaae9NDGsGI5CyE+XcBunSt0CWQFpkL87w=";
  };

  appimageContents = appimageTools.extractType2 {inherit pname version src;};
in
  appimageTools.wrapType2 {
    inherit pname version src;

    extraInstallCommands = ''
      mv $out/bin/${pname}-${version} $out/bin/${pname}

      install -Dm444 ${appimageContents}/feishin.desktop -t $out/share/applications
      substituteInPlace $out/share/applications/feishin.desktop \
        --replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
      cp -r ${appimageContents}/usr/share/icons $out/share
    '';
  }