0

I recently migrated from Arch Linux to NixOS. While fiddling with NixOS configuration, I noticed there is a section to configure the fonts. This is how it looks like on my end:

{ config, pkgs, ... }:

{
  imports = [
    ./hardware-configuration.nix
  ];

  ...

  fonts = {
    enableDefaultFonts = true;
    fontDir.enable = true;
    fontconfig = {
      antialias = true;
      cache32Bit = true;
      # TODO: Set fonts within GNOME Tweaks for the time being
      # defaultFonts = {
      #   monospace = [ "Ubuntu Mono Regular" ];
      #   sansSerif = [ "Ubuntu Regular" ];
      #   serif = [ "Ubuntu Regular" ];
      # };
      hinting.autohint = true;
      hinting.enable = true;
    };
    fonts = with pkgs; [
      noto-fonts
      noto-fonts-cjk
      noto-fonts-emoji
      # noto-fonts-extra
      ubuntu_font_family
    ];
  };
  ...
}

What I'm trying to achieve is to set the Ubuntu fonts in the same way I do using GNOME Tweaks:

enter image description here

I wonder if fonts.fontconfig.defaultFonts (or any other settings) could be used for this purpose? So far I've tried to do it as such, but they aren't set correctly.

1 Answer 1

1

That depends on whether those applications respect the fontconfig configuration. If GNOME tweaks does not do that, configuring fontconfig has no visible effect.

In order to configure GNOME things declaratively, perhaps check out home-manager's dconf options.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .