How to set fractional scaling via nix configuration for Gnome / Wayland

Additionally, add xwayland-native-scaling for some applications to scale properly:

extraGSettingsOverrides = ''
    [org.gnome.mutter]
    experimental-features=['scale-monitor-framebuffer', 'xwayland-native-scaling']
  '';

Thanks for the post, helped a lot!


Additionally as of 2025-07-24 unstable, it got a lot cleaner to enable gnome:


{ pkgs, ... }:
{
  # Enable the GNOME Desktop Environment.
  services.displayManager.gdm.enable = true;
  services.desktopManager.gnome.enable = true;

  services.desktopManager.gnome.extraGSettingsOverrides = ''
    [org.gnome.mutter]
    experimental-features=['scale-monitor-framebuffer', 'xwayland-native-scaling']
  '';
}

(Mutter is the default compositor for GNOME Desktop Environment., so no need explicitly enable it anymore)