From 7f9acb799d6b738340282342b8a623f64b148798 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Thu, 9 Jul 2020 13:02:09 -0300 Subject: [PATCH] Zettlr: init at 1.7.5 Fixes #81516 --- pkgs/applications/misc/zettlr/default.nix | 38 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/applications/misc/zettlr/default.nix diff --git a/pkgs/applications/misc/zettlr/default.nix b/pkgs/applications/misc/zettlr/default.nix new file mode 100644 index 000000000000..3d762d9ab2a7 --- /dev/null +++ b/pkgs/applications/misc/zettlr/default.nix @@ -0,0 +1,38 @@ +{ appimageTools, lib, fetchurl, gtk3, gsettings-desktop-schemas}: + +# Based on https://gist.github.com/msteen/96cb7df66a359b827497c5269ccbbf94 and joplin-desktop nixpkgs. +let + pname = "zettlr"; + version = "1.7.5"; + name = "${pname}-${version}"; + src = fetchurl { + url = "https://github.com/Zettlr/Zettlr/releases/download/v${version}/Zettlr-${version}-x86_64.appimage"; + sha256 = "040lx01ywdpla34d4abkmh51kchr11s17la6fk6yq77y8zb87xzi"; + }; + 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 = with lib; { + description = "A markdown editor for writing academic texts and taking notes"; + homepage = "https://www.zettlr.com"; + platforms = [ "x86_64-linux" ]; + license = licenses.gpl3; + maintainers = with maintainers; [ tfmoraes ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e1f9b43b1e77..09afcd078868 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27821,4 +27821,6 @@ in gpio-utils = callPackage ../os-specific/linux/kernel/gpio-utils.nix { }; navidrome = callPackage ../servers/misc/navidrome {}; + + zettlr = callPackage ../applications/misc/zettlr { }; }