1{ lib, ... }:
2{
3 name = "noto-fonts";
4 meta.maintainers = with lib.maintainers; [
5 nickcao
6 midchildan
7 ];
8
9 nodes.machine =
10 { pkgs, ... }:
11 {
12 imports = [ ./common/x11.nix ];
13 environment.systemPackages = [ pkgs.gedit ];
14 fonts = {
15 enableDefaultPackages = false;
16 fonts = with pkgs; [
17 noto-fonts
18 noto-fonts-cjk-sans
19 noto-fonts-cjk-serif
20 noto-fonts-color-emoji
21 ];
22 fontconfig.defaultFonts = {
23 serif = [
24 "Noto Serif"
25 "Noto Serif CJK SC"
26 ];
27 sansSerif = [
28 "Noto Sans"
29 "Noto Sans CJK SC"
30 ];
31 monospace = [
32 "Noto Sans Mono"
33 "Noto Sans Mono CJK SC"
34 ];
35 emoji = [ "Noto Color Emoji" ];
36 };
37 };
38 };
39
40 testScript =
41 # extracted from http://www.clagnut.com/blog/2380/
42 let
43 testText = builtins.toFile "test.txt" ''
44 the quick brown fox jumps over the lazy dog
45 視野無限廣,窗外有藍天
46 Eĥoŝanĝo ĉiuĵaŭde.
47 いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす
48 다람쥐 헌 쳇바퀴에 타고파
49 中国智造,慧及全球
50 '';
51 in
52 ''
53 machine.wait_for_x()
54 machine.succeed("gedit ${testText} >&2 &")
55 machine.wait_for_window(".* - gedit")
56 machine.sleep(10)
57 machine.screenshot("screen")
58 '';
59}