summary refs log tree commit diff
path: root/nixos/tests/fontconfig-default-fonts.nix
blob: 68c6ac9e9c8337154fb0b29338b0117d30807175 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import ./make-test-python.nix ({ lib, ... }:
{
  name = "fontconfig-default-fonts";

  meta.maintainers = with lib.maintainers; [
    jtojnar
    worldofpeace
  ];

  machine = { config, pkgs, ... }: {
    fonts.enableDefaultFonts = true; # Background fonts
    fonts.fonts = with pkgs; [
      noto-fonts-emoji
      cantarell-fonts
      twitter-color-emoji
      source-code-pro
      gentium
    ];
    fonts.fontconfig.defaultFonts = {
      serif = [ "Gentium Plus" ];
      sansSerif = [ "Cantarell" ];
      monospace = [ "Source Code Pro" ];
      emoji = [ "Twitter Color Emoji" ];
    };
  };

  testScript = ''
    machine.succeed("fc-match serif | grep '\"Gentium Plus\"'")
    machine.succeed("fc-match sans-serif | grep '\"Cantarell\"'")
    machine.succeed("fc-match monospace | grep '\"Source Code Pro\"'")
    machine.succeed("fc-match emoji | grep '\"Twitter Color Emoji\"'")
  '';
})