Fonts: Difference between revisions
m style fixes :-) |
Simplified the Flatpak font/icon/theme fixes part and made them directly use the host font/icon/theme instead of manually declaring separate packages |
||
| Line 375: | Line 375: | ||
<translate>==== Solution 3: Configure bindfs for fonts/cursors/icons support ==== <!--T:67--></translate> | <translate>==== Solution 3: Configure bindfs for fonts/cursors/icons support ==== <!--T:67--></translate> | ||
<translate><!--T:68--> | <translate><!--T:68--> | ||
Alternatively, you can expose relevant | Alternatively, you can expose relevant host paths in <code>/run/current-system/sw/share/</code> directly under <code>/usr/share/...</code> paths. This will also enable Flatpak to use a custom cursor theme if you have one.<syntaxhighlight lang="nixos" line="1"> | ||
system.fsPackages = [ pkgs.bindfs ]; | # flatpak-usr-fix.nix | ||
{ pkgs, ... }: | |||
device = | { | ||
# Bind mounts fonts, icons and themes from | |||
# The /run/current-system/sw/share/* paths | |||
# to their /usr/share/* equivalents | |||
# Expose all fonts | |||
# under /run/current-system/sw/share/X11/fonts | |||
fonts.fontDir.enable = true; | |||
# Flatpak: Bind mounts /usr/share/* directories | |||
system.fsPackages = [ pkgs.bindfs ]; | |||
# Fonts | |||
fileSystems."/usr/share/fonts" = { | |||
device = "/run/current-system/sw/share/X11/fonts"; | |||
fsType = "fuse.bindfs"; | fsType = "fuse.bindfs"; | ||
options = [ "ro" "resolve-symlinks" "x-gvfs-hide" ]; | options = [ | ||
"ro" | |||
"resolve-symlinks" | |||
"x-gvfs-hide" | |||
]; | |||
}; | }; | ||
# Icons | |||
fileSystems."/usr/share/icons" = { | |||
device = "/run/current-system/sw/share/icons"; | |||
fsType = "fuse.bindfs"; | |||
options = [ | |||
"ro" | |||
"resolve-symlinks" | |||
"x-gvfs-hide" | |||
]; | |||
}; | |||
]; | # Themes | ||
fileSystems."/usr/share/themes" = { | |||
device = "/run/current-system/sw/share/themes"; | |||
fsType = "fuse.bindfs"; | |||
options = [ | |||
"ro" | |||
"resolve-symlinks" | |||
"x-gvfs-hide" | |||
]; | ]; | ||
}; | }; | ||
} | |||
} | |||
</syntaxhighlight>Note that font cache inside flatpak container may not be recreated after changes to fonts in <code>/usr/share/fonts</code>, because font cache seem to be relying on file timestamps that are missing in <code>/nix/store</code>. | </syntaxhighlight>Note that font cache inside flatpak container may not be recreated after changes to fonts in <code>/usr/share/fonts</code>, because font cache seem to be relying on file timestamps that are missing in <code>/nix/store</code>. | ||
</translate> | </translate> | ||