From 619d153b32c06b2528c812d3b79ba67f9ca4b0e5 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Sat, 7 Sep 2024 23:03:44 -0600 Subject: [PATCH] zettlr: 3.0.2 -> 3.2.0, respect `NIXOS_OZONE_WL` --- pkgs/applications/misc/zettlr/default.nix | 4 +-- pkgs/applications/misc/zettlr/generic.nix | 30 ++++++++++++++--------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/misc/zettlr/default.nix b/pkgs/applications/misc/zettlr/default.nix index 593ca13f9fee..7ac5133d11b9 100644 --- a/pkgs/applications/misc/zettlr/default.nix +++ b/pkgs/applications/misc/zettlr/default.nix @@ -2,7 +2,7 @@ builtins.mapAttrs (pname: attrs: callPackage ./generic.nix (attrs // { inherit pname; })) { zettlr = { - version = "3.0.2"; - hash = "sha256-xwBq+kLmTth15uLiYWJOhi/YSPZVJNO6JTrKFojSDXA="; + version = "3.2.0"; + hash = "sha256-gttDGWFJ/VmOyqgOSKnCqqPtNTKJd1fmDpa0ZAX3xc8="; }; } diff --git a/pkgs/applications/misc/zettlr/generic.nix b/pkgs/applications/misc/zettlr/generic.nix index 777c74a5dffe..ad340558bd46 100644 --- a/pkgs/applications/misc/zettlr/generic.nix +++ b/pkgs/applications/misc/zettlr/generic.nix @@ -1,9 +1,11 @@ -{ pname -, version -, hash -, appimageTools -, lib -, fetchurl +{ + pname, + version, + hash, + appimageTools, + lib, + fetchurl, + makeWrapper, }: # Based on https://gist.github.com/msteen/96cb7df66a359b827497c5269ccbbf94 and joplin-desktop nixpkgs. @@ -19,21 +21,27 @@ in appimageTools.wrapType2 rec { inherit pname version src; - extraPkgs = pkgs: [ pkgs.texliveMedium pkgs.pandoc ]; + extraPkgs = pkgs: [ + pkgs.texliveMedium + pkgs.pandoc + ]; extraInstallCommands = '' + source "${makeWrapper}/nix-support/setup-hook" + wrapProgram $out/bin/zettlr \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" 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}' + --replace-fail 'Exec=AppRun' 'Exec=${pname}' ''; - meta = with lib; { + meta = { description = "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 ]; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ tfmoraes ]; mainProgram = "zettlr"; }; }