Vyuh

Finite State Magic

Default Fonts on NixOS

Last Modified on July 30, 2025

Tags: nixos fontconfig

The approach used in the fontconfig package of nixos to setting default fonts is to use the <prefer> directive. However, the user’s custom configuration files fail override these fonts as the user configuration files are loaded before the nixos default font configuration. To work around this issue, I had to use the binding=strong parameter in my fonts.conf. I intend to explore what can be done in configuration.nix to get the system to do the proper thing, namely, to use the <default> directive instead of <prefer>. It appears to be a low-hanging fruit, but even if I manage to make it work on my machine, there may be implicit assumptions by the package maintainers about the configuration file load order and the logic of font selection which I’ll have to clearly address before I can submit an issue or pull request.

It is the bane of those with an appreciation of good typography that they cannot stand the sight of otherwise fully functional software just because the fonts and are not according to their preference. Restaurant Menus, Banners, Hoardings, and Manuscripts composed with Microsoft Word frequently attract my scorn.