about summary refs log tree commit diff
path: root/modules/nixos/fonts.nix
blob: f11a27dbec4f5103494d4f89cf22cb1b2e32377a (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
{
  config,
  lib,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.fonts;
in {
  config = mkMerge [
    (mkIf cfg.enable {
      hm.fonts.fontconfig.enable = true;
      fonts = {
        inherit (cfg) packages;

        fontconfig = {
          enable = true;

          defaultFonts = {
            monospace = [
              "Iosevka"
              "Sarasa Mono K"
              "Sarasa Mono J"
              "Sarasa Mono SC"
              "Sarasa Mono CL"
            ];
            sansSerif = [
              "Iosevka Aile"
              "Sarasa Gothic K"
              "Sarasa Gothic J"
              "Sarasa Gothic SC"
              "Sarasa Gothic CL"
            ];
            serif = [
              "Iosevka Etoile"
              "Sarasa Gothic K"
              "Sarasa Gothic J"
              "Sarasa Gothic SC"
              "Sarasa Gothic CL"
            ];
          };
        };
      };
    })
    (mkIf (!cfg.enable) {
      hm.fonts.fontconfig.enable = false;
      fonts.fontconfig.enable = false;
    })
  ];
}

Consider giving Nix/NixOS a try! <3