blob: 483de0de8be7e91201c0e008a4a43d83a5721323 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.nixfiles.modules.fonts;
in {
imports = [
(mkAliasOptionModule ["fontScheme"] [
"nixfiles"
"modules"
"fonts"
"fontScheme"
])
];
options.nixfiles.modules.fonts = {
enable = mkEnableOption "fonts and their configurations";
fontScheme = let
mkFont = {
family,
style,
size,
}: {
family = mkOption {
description = "Family of the font.";
type = types.str;
default = family;
};
style = mkOption {
description = "Style of the font.";
type = types.str;
default = style;
};
size = mkOption {
description = "Size of the font.";
type = types.int;
default = size;
};
};
in {
serifFont = mkFont {
family = "Iosevka Etoile";
style = "Regular";
size = 14;
};
serifFontFallback = mkFont {
family = "Sarasa Gothic J";
style = "Regular";
size = 14;
};
sansSerifFont = mkFont {
family = "Iosevka Aile";
style = "Regular";
size = 14;
};
sansSerifFontFallback = mkFont {
family = "Sarasa Gothic J";
style = "Regular";
size = 14;
};
monospaceFont = mkFont {
family = "Iosevka";
style = "Regular";
size = 14;
};
monospaceFontFallback = mkFont {
family = "Sarasa Mono J";
style = "Regular";
size = 14;
};
};
};
config = mkIf cfg.enable {
fonts.fonts = with pkgs; [
iosevka-bin
(iosevka-bin.override {variant = "aile";})
(iosevka-bin.override {variant = "etoile";})
sarasa-gothic
];
};
}
|