From f33c5896d89052fbc5f776564efc8210a56e9cb7 Mon Sep 17 00:00:00 2001 From: Myned Date: Sat, 22 Feb 2025 12:55:24 -0600 Subject: [PATCH] fonts: work around fonts for some apps Signed-off-by: Myned --- options/custom/settings/fonts.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/options/custom/settings/fonts.nix b/options/custom/settings/fonts.nix index bc9943b..cc24ddb 100644 --- a/options/custom/settings/fonts.nix +++ b/options/custom/settings/fonts.nix @@ -90,6 +90,20 @@ in { }; }; - home-manager.users.${config.custom.username}.fonts.fontconfig.defaultFonts = config.fonts.fontconfig.defaultFonts; + home-manager.sharedModules = [ + { + # Inherit from system module + fonts.fontconfig.defaultFonts = config.fonts.fontconfig.defaultFonts; + + # HACK: Some applications do not support fontconfig nor symlinks, so copy fonts to user directory + # https://github.com/ONLYOFFICE/DocumentServer/issues/1859 et al. + home.activation = { + copy-fonts = lib.home-manager.hm.dag.entryAfter ["writeBoundary"] '' + run cp --recursive --dereference --force \ + /run/current-system/sw/share/fonts "$XDG_DATA_HOME/" + ''; + }; + } + ]; }; }