{
  appimageTools,
  lib,
  fetchurl,
  gtk3,
  gsettings-desktop-schemas,
}: let
  pname = "zettlr";
  version = "1.8.7";
  name = "${pname}-${version}";
  src = fetchurl {
    url = "https://github.com/Zettlr/Zettlr/releases/download/v${version}/Zettlr-${version}-x86_64.appimage";
    sha256 = "sha256-gJleqyK/c4ERTnj7sBtRxDrEHm91Ac38H0ukicukdX0=";
  };
  appimageContents = appimageTools.extractType2 {
    inherit name src;
  };
in
  appimageTools.wrapType2 rec {
    inherit name src;

    profile = ''
      export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
    '';

    multiPkgs = null; # no 32bit needed
    extraPkgs = appimageTools.defaultFhsEnvArgs.multiPkgs;
    extraInstallCommands = ''
      mv $out/bin/{${name},${pname}}
      install -m 444 -D ${appimageContents}/Zettlr.desktop $out/share/applications/Zettlr.desktop
      install -m 444 -D ${appimageContents}/Zettlr.png $out/share/icons/hicolor/512x512/apps/Zettlr.png
      substituteInPlace $out/share/applications/Zettlr.desktop --replace 'Exec=AppRun' 'Exec=${pname}'
    '';

    meta = {
      description = "A markdown editor for writing academic texts and taking notes";
      homepage = "https://www.zettlr.com";
      platforms = ["x86_64-linux"];
      license = lib.licenses.gpl3;
    };
  }
