about summary refs log tree commit diff
path: root/modules/nixos/fonts.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-11-09 03:00:14 +0300
committerAzat Bahawi <azat@bahawi.net>2023-11-09 03:00:14 +0300
commit303b8e2ed8b836858b4dc6ca2210178ace9c6b6f (patch)
treeeb0f4fbda60c70e86921109033c842fca1b3824f /modules/nixos/fonts.nix
parent2023-11-05 (diff)
2023-11-09
Diffstat (limited to 'modules/nixos/fonts.nix')
-rw-r--r--modules/nixos/fonts.nix55
1 files changed, 39 insertions, 16 deletions
diff --git a/modules/nixos/fonts.nix b/modules/nixos/fonts.nix
index f11a27d..f9624ec 100644
--- a/modules/nixos/fonts.nix
+++ b/modules/nixos/fonts.nix
@@ -1,6 +1,7 @@
 {
   config,
   lib,
+  pkgs,
   ...
 }:
 with lib; let
@@ -8,36 +9,58 @@ with lib; let
 in {
   config = mkMerge [
     (mkIf cfg.enable {
+      nixfiles.modules.common.nix.allowedUnfreePackages = ["symbola"];
       hm.fonts.fontconfig.enable = true;
       fonts = {
-        inherit (cfg) packages;
+        packages = cfg.packages ++ [pkgs.symbola];
 
         fontconfig = {
           enable = true;
 
           defaultFonts = {
-            monospace = [
+            emoji = mkForce [
+              "Twitter Color Emoji"
+              "Noto Color Emoji"
+              "Symbola"
+            ];
+            monospace = mkForce [
               "Iosevka"
-              "Sarasa Mono K"
-              "Sarasa Mono J"
-              "Sarasa Mono SC"
-              "Sarasa Mono CL"
+              "Sarasa Mono"
+              "Source Han Mono"
+              "Noto Sans Mono"
             ];
-            sansSerif = [
+            sansSerif = mkForce [
               "Iosevka Aile"
-              "Sarasa Gothic K"
-              "Sarasa Gothic J"
-              "Sarasa Gothic SC"
-              "Sarasa Gothic CL"
+              "Sarasa Gothic"
+              "Source Han Sans"
+              "Noto Sans"
             ];
-            serif = [
+            serif = mkForce [
               "Iosevka Etoile"
-              "Sarasa Gothic K"
-              "Sarasa Gothic J"
-              "Sarasa Gothic SC"
-              "Sarasa Gothic CL"
+              "Sarasa Gothic"
+              "Source Han Serif"
+              "Noto Serif"
             ];
           };
+
+          localConf = ''
+            <?xml version='1.0'?>
+            <!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
+            <fontconfig>
+              <alias binding="same">
+                <family>Helvetica</family>
+                <prefer>
+                  <family>sans-serif</family>
+                </prefer>
+              </alias>
+              <alias binding="same">
+                <family>Arial</family>
+                <prefer>
+                  <family>sans-serif</family>
+                </prefer>
+              </alias>
+            </fontconfig>
+          '';
         };
       };
     })

Consider giving Nix/NixOS a try! <3