git.iko.soy/typeable/nixpkgs
on master help sign in
nixos.tests.fontconfig-default-fonts: init

Make sure the fonts.enableDefaultFonts option works.

commitee7c590b605d07394f0f65c603bf5cf169e6caad authorJan Tojnar <jtojnar@gmail.com> dateThu 29 Aug 2019, 14:02 (7 years ago) parentb31c7e5
3 files changed+30
nixos/release-combined.nix+1 nixos/tests/all-tests.nix+1 nixos/tests/fontconfig-default-fonts.nix+28
nixos/release-combined.nix+1
@@ -68,6 +68,7 @@ in rec {
6868 nixos.tests.chromium.x86_64-linux or []
6969 (all nixos.tests.firefox)
7070 (all nixos.tests.firewall)
71+ (all nixos.tests.fontconfig-default-fonts)
7172 (all nixos.tests.gnome3-xorg)
7273 (all nixos.tests.gnome3)
7374 (all nixos.tests.pantheon)
nixos/tests/all-tests.nix+1
@@ -87,6 +87,7 @@ in
8787 flatpak = handleTest ./flatpak.nix {};
8888 flatpak-builder = handleTest ./flatpak-builder.nix {};
8989 fluentd = handleTest ./fluentd.nix {};
90+ fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
9091 fsck = handleTest ./fsck.nix {};
9192 fwupd = handleTestOn ["x86_64-linux"] ./fwupd.nix {}; # libsmbios is unsupported on aarch64
9293 gdk-pixbuf = handleTest ./gdk-pixbuf.nix {};
nixos/tests/fontconfig-default-fonts.nixnew file+28
@@ -0,0 +1,28 @@
1+import ./make-test.nix ({ lib, ... }:
2+{
3+ name = "fontconfig-default-fonts";
4+
5+ machine = { config, pkgs, ... }: {
6+ fonts.enableDefaultFonts = true; # Background fonts
7+ fonts.fonts = with pkgs; [
8+ noto-fonts-emoji
9+ cantarell-fonts
10+ twitter-color-emoji
11+ source-code-pro
12+ gentium
13+ ];
14+ fonts.fontconfig.defaultFonts = {
15+ serif = [ "Gentium Plus" ];
16+ sansSerif = [ "Cantarell" ];
17+ monospace = [ "Source Code Pro" ];
18+ emoji = [ "Twitter Color Emoji" ];
19+ };
20+ };
21+
22+ testScript = ''
23+ $machine->succeed("fc-match serif | grep '\"Gentium Plus\"'");
24+ $machine->succeed("fc-match sans-serif | grep '\"Cantarell\"'");
25+ $machine->succeed("fc-match monospace | grep '\"Source Code Pro\"'");
26+ $machine->succeed("fc-match emoji | grep '\"Twitter Color Emoji\"'");
27+ '';
28+})