Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/applications/misc/zettlr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

builtins.mapAttrs (pname: attrs: callPackage ./generic.nix (attrs // { inherit pname; })) {
zettlr = {
version = "3.2.0";
hash = "sha256-gttDGWFJ/VmOyqgOSKnCqqPtNTKJd1fmDpa0ZAX3xc8=";
version = "3.3.1";
hash = "sha256-jKqe3dEWEtg/SqY2sfgi+AaPOk2fn4tfEMhNDGlJMQw=";
};
}
11 changes: 10 additions & 1 deletion pkgs/applications/misc/zettlr/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
lib,
fetchurl,
makeWrapper,
# command line arguments which are always set e.g ["--wayland-text-input-version=3"]
commandLineArgs ? [ ],
testers,
zettlr,
}:

# Based on https://gist.github.com/msteen/96cb7df66a359b827497c5269ccbbf94 and joplin-desktop nixpkgs.
Expand All @@ -30,13 +34,18 @@ appimageTools.wrapType2 rec {

extraInstallCommands = ''
wrapProgram $out/bin/zettlr \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--add-flags ${lib.escapeShellArg commandLineArgs}
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-fail 'Exec=AppRun' 'Exec=${pname}'
'';

passthru.tests.version = testers.testVersion {
package = zettlr;
};

meta = {
description = "Markdown editor for writing academic texts and taking notes";
homepage = "https://www.zettlr.com";
Expand Down