diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index ffa087bb6f28..9e2109d88b5f 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -68,6 +68,7 @@ in rec { nixos.tests.chromium.x86_64-linux or [] (all nixos.tests.firefox) (all nixos.tests.firewall) + (all nixos.tests.fontconfig-default-fonts) (all nixos.tests.gnome3-xorg) (all nixos.tests.gnome3) (all nixos.tests.pantheon) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 557ee78df7c6..14dca7409c46 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -87,6 +87,7 @@ in flatpak = handleTest ./flatpak.nix {}; flatpak-builder = handleTest ./flatpak-builder.nix {}; fluentd = handleTest ./fluentd.nix {}; + fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {}; fsck = handleTest ./fsck.nix {}; fwupd = handleTestOn ["x86_64-linux"] ./fwupd.nix {}; # libsmbios is unsupported on aarch64 gdk-pixbuf = handleTest ./gdk-pixbuf.nix {}; diff --git a/nixos/tests/fontconfig-default-fonts.nix b/nixos/tests/fontconfig-default-fonts.nix new file mode 100644 index 000000000000..1991cec92189 --- /dev/null +++ b/nixos/tests/fontconfig-default-fonts.nix @@ -0,0 +1,28 @@ +import ./make-test.nix ({ lib, ... }: +{ + name = "fontconfig-default-fonts"; + + 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\"'"); + ''; +})