From eda196447680bdb623fd2bfa273970e187862e33 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Tue, 2 Jan 2024 10:56:15 +0100 Subject: [PATCH] obsidian and signal: sharp font on wayland --- modules/obsidian.nix | 8 ++++---- modules/signal-desktop.nix | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/obsidian.nix b/modules/obsidian.nix index e69bd47..e7fa993 100644 --- a/modules/obsidian.nix +++ b/modules/obsidian.nix @@ -6,10 +6,6 @@ # export LD_LIBRARY_PATH=$(nix --extra-experimental-features nix-command --extra-experimental-features flakes build --print-out-paths --no-link nixpkgs#libGL)/lib # obsidian - # TODO: Only if on wayland and display scaling != 1 - # To have sharp font, start obsidian with: - # obsidian --enable-features=UseOzonePlatform --ozone-platform=x11 - # This `config` is only for "stable" `nixpkgs`, not for "unstable". # See nur-and-unstable.nix # nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ @@ -24,4 +20,8 @@ unstable.obsidian # Markdown notes ]; }; + + # TODO: if on wayland and scaling != 1 + # Sharp fonts. + # obsidian --enable-features=UseOzonePlatform --ozone-platform=x11 } diff --git a/modules/signal-desktop.nix b/modules/signal-desktop.nix index c3eb831..201b9ed 100644 --- a/modules/signal-desktop.nix +++ b/modules/signal-desktop.nix @@ -8,4 +8,19 @@ # Signal does also use the NIXOS_OZONE_WL variable to enable Wayland support. environment.sessionVariables.NIXOS_OZONE_WL = lib.mkIf (config.services.xserver.displayManager.gdm.wayland) "1"; + + # TODO: if on wayland and scaling != 1 + # Sharp fonts. + nixpkgs.overlays = lib.mkIf (config.services.xserver.displayManager.gdm.wayland) [ + (self: super: { + signal-desktop = super.signal-desktop.overrideAttrs (old: { + preFixup = (old.preFixup or "") + '' + gappsWrapperArgs+=( + --add-flags "--enable-features=UseOzonePlatform" + --add-flags "--ozone-platform=x11" + ) + ''; + }); + }) + ]; }