2020-07-18 16:06:22 +00:00
|
|
|
{ appimageTools, fetchurl, lib, gsettings-desktop-schemas, gtk3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "marktext";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "v0.16.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "${pname}-${version}-binary";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/marktext/marktext/releases/download/${version}/marktext-x86_64.AppImage";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "0s93c79vy2vsi7b6xq4hvsvjjad8bdkhl1q135vp98zmbf7bvm9b";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
|
|
inherit name src;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
appimageTools.wrapType2 rec {
|
|
|
|
inherit name src;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
profile = ''
|
|
|
|
export LC_ALL=C.UTF-8
|
2020-07-18 16:06:22 +00:00
|
|
|
''
|
|
|
|
# Fixes file open dialog error
|
|
|
|
# GLib-GIO-ERROR **: 20:36:48.243: No GSettings schemas are installed on the system
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/83701#issuecomment-608034097
|
|
|
|
+ ''
|
|
|
|
export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
multiPkgs = null; # no 32bit needed
|
|
|
|
extraPkgs = p: (appimageTools.defaultFhsEnvArgs.multiPkgs p) ++ [
|
|
|
|
p.libsecret
|
2021-03-19 17:17:44 +00:00
|
|
|
p.xorg.libxkbfile
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
extraInstallCommands = ''
|
|
|
|
# Strip version from binary name.
|
|
|
|
mv $out/bin/${name} $out/bin/${pname}
|
|
|
|
|
|
|
|
install -m 444 -D ${appimageContents}/marktext.desktop $out/share/applications/marktext.desktop
|
|
|
|
substituteInPlace $out/share/applications/marktext.desktop \
|
|
|
|
--replace "Exec=AppRun" "Exec=${pname} --"
|
|
|
|
|
|
|
|
cp -r ${appimageContents}/usr/share/icons $out/share
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "A simple and elegant markdown editor, available for Linux, macOS and Windows";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://marktext.app";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ nh2 ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|