1{ config, lib, helpers, ... }:
2
3with lib;
4let
5 cfg = config.modules.fonts;
6 fontsPath = if helpers.isDarwin then "Library/Fonts" else "${config.xdg.dataHome}/fonts";
7in {
8 options.modules.fonts = {
9 enable = mkOption {
10 default = true;
11 description = "Whether to enable fonts options.";
12 type = types.bool;
13 };
14 };
15
16 config = mkIf cfg.enable {
17 fonts.fontconfig.enable = true;
18
19 age.secrets."DankMono-Regular.otf" = {
20 symlink = false;
21 file = ./encrypt/DankMono-Regular.otf.age;
22 path = "${fontsPath}/DankMono-Regular.otf";
23 mode = "755";
24 };
25
26 age.secrets."DankMono-Italic.otf" = {
27 symlink = false;
28 file = ./encrypt/DankMono-Italic.otf.age;
29 path = "${fontsPath}/DankMono-Italic.otf";
30 mode = "755";
31 };
32
33 age.secrets."DankMono-Bold.otf" = {
34 symlink = false;
35 file = ./encrypt/DankMono-Bold.otf.age;
36 path = "${fontsPath}/DankMono-Bold.otf";
37 mode = "755";
38 };
39
40 age.secrets."codicon.otf" = {
41 symlink = false;
42 file = ./encrypt/codicon.otf.age;
43 path = "${fontsPath}/codicon.otf";
44 mode = "755";
45 };
46
47 age.secrets."faicon.ttf" = {
48 symlink = false;
49 file = ./encrypt/faicon.ttf.age;
50 path = "${fontsPath}/faicon.ttf";
51 mode = "755";
52 };
53 };
54}