Fixing high resolution font aliasing for Wayland on NixOS
Planted February 25, 2025
Categories: Quick Tips
Tags: wayland
, xwayland
, nixos
Problem
With the progress on Wayland architecture and the usability of its software ecosystem, I’m adapting it more and more. This is quite easy to achieve these days, specially with NixOS friendliness of Hyprland. However, I had a weird issue with my Framework 13th’s high resolution monitor.
The font’s on Chrome based applications were looking pixelated, and specially in high res, it wasn’t just the look of it which wasn’t appealing, but I was losing the readability.
Solution
The main reason for it seems to be related to XWayland. An X Server, designed to run under Wayland, helping applicaitons, which don’t have Wayland support out of the box.
And apparently, Chrome related stuff, by default prefer to run on X. To address this, we can either set the following environment variable globally in NixOS:
# somewhere in your NixOS configuration
environment.sessionVariables.NIXOS_OZONE_WL = "1";
Or you can use chrome://flags
and set the following per application:

This is of course not available for applications like Slack, which makes the environment variable setting a more promissing option.