summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2019-11-15 16:49:57 +0100
committerAlan Pearce2019-11-15 16:49:57 +0100
commit51d8e83616ac4efcb1136efd7740f2e3a486e81b (patch)
tree65d553073390919b9b05582ecdc252883d4a0716
parente3e50821333e13cb7d964c597336f3805716e60e (diff)
downloadnixfiles-51d8e83616ac4efcb1136efd7740f2e3a486e81b.tar.lz
nixfiles-51d8e83616ac4efcb1136efd7740f2e3a486e81b.tar.zst
nixfiles-51d8e83616ac4efcb1136efd7740f2e3a486e81b.zip
xserver: configure font stack based on antialias setting
-rw-r--r--system/settings/services/xserver.nix34
1 files changed, 20 insertions, 14 deletions
diff --git a/system/settings/services/xserver.nix b/system/settings/services/xserver.nix
index 1105f17f..69f26307 100644
--- a/system/settings/services/xserver.nix
+++ b/system/settings/services/xserver.nix
@@ -1,5 +1,6 @@
-{ config, pkgs, ... }:
+{ config, lib, pkgs, ... }:
 
+with lib;
 { services.xserver = {
     enable = true;
     enableCtrlAltBackspace = true;
@@ -36,18 +37,19 @@
     enableFontDir = true;
     enableDefaultFonts = false;
     fontconfig = {
-      useEmbeddedBitmaps = true;
-      defaultFonts = {
-        monospace = [ "Liberation Mono" ];
-        sansSerif = [ "Liberation Sans" ];
-        serif = [ "Liberation Serif" ];
+      antialias = true;
+      subpixel = mkIf config.fonts.fontconfig.antialias {
+        lcdfilter = "light";
       };
-      penultimate = {
+      ultimate = mkIf config.fonts.fontconfig.antialias {
         enable = true;
+        preset = "ultimate3";
       };
-      ultimate = {
-        enable = false;
-        preset = "osx";
+      useEmbeddedBitmaps = !config.fonts.fontconfig.antialias;
+      defaultFonts = {
+        monospace = [ "Source Code Pro" ];
+        sansSerif = [ "Tahoma" ];
+        serif = [ "Times New Roman" ];
       };
     };
     fonts = with pkgs; [
@@ -56,14 +58,21 @@
       tamsyn
       terminus_font
 
+      corefonts
+
       fantasque-sans-mono
       emacs-all-the-icons-fonts
+      font-awesome_5
+      xorg.fontmiscmisc
+      xorg.fontcursormisc
+      xorg.fontbhlucidatypewriter100dpi
+    ] ++ lib.optionals config.fonts.fontconfig.antialias [
       fira
       fira-code
       fira-mono
       go-font
-      font-awesome_5
       ibm-plex
+
       liberation_ttf
       mononoki
       roboto
@@ -72,9 +81,6 @@
       source-code-pro
       source-sans-pro
       source-serif-pro
-      xorg.fontmiscmisc
-      xorg.fontcursormisc
-      xorg.fontbhlucidatypewriter100dpi
     ];
   };
 }