about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2014-11-30 13:49:19 -0600
committerThomas Tuegel <ttuegel@gmail.com>2014-12-08 10:55:24 -0600
commit8991ff7ceb1019751b00d97bd343ad6797177101 (patch)
treef515d4e6656d7a3b29c363c2b17d160349f8547e /nixos
parent1df1305a8a313120219e70ed1f50618b1047963d (diff)
downloadnixlib-8991ff7ceb1019751b00d97bd343ad6797177101.tar
nixlib-8991ff7ceb1019751b00d97bd343ad6797177101.tar.gz
nixlib-8991ff7ceb1019751b00d97bd343ad6797177101.tar.bz2
nixlib-8991ff7ceb1019751b00d97bd343ad6797177101.tar.lz
nixlib-8991ff7ceb1019751b00d97bd343ad6797177101.tar.xz
nixlib-8991ff7ceb1019751b00d97bd343ad6797177101.tar.zst
nixlib-8991ff7ceb1019751b00d97bd343ad6797177101.zip
Load default Fontconfig settings into Xresources for Xft
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/x11/display-managers/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix
index 6b01cde9e2b4..8bc8175f88f9 100644
--- a/nixos/modules/services/x11/display-managers/default.nix
+++ b/nixos/modules/services/x11/display-managers/default.nix
@@ -23,6 +23,17 @@ let
     pathsToLink = [ "/" ];
   };
 
+  fontconfig = config.fonts.fontconfig;
+  xresourcesXft = pkgs.writeText "Xresources-Xft" ''
+    ${optionalString (fontconfig.dpi != 0) ''Xft.dpi: ${fontconfig.dpi}''}
+    Xft.antialias: ${if fontconfig.antialias then "1" else "0"}
+    Xft.rgba: ${fontconfig.subpixel.rgba}
+    Xft.lcdfilter: lcd${fontconfig.subpixel.lcdfilter}
+    Xft.hinting: ${if fontconfig.hinting.enable then "1" else "0"}
+    Xft.autohint: ${if fontconfig.hinting.autohint then "1" else "0"}
+    Xft.hintstyle: hint${fontconfig.hinting.style}
+  '';
+
   # file provided by services.xserver.displayManager.session.script
   xsession = wm: dm: pkgs.writeScript "xsession"
     ''
@@ -79,6 +90,7 @@ let
       ''}
 
       # Load X defaults.
+      ${xorg.xrdb}/bin/xrdb -merge ${xresourcesXft}
       if test -e ~/.Xresources; then
           ${xorg.xrdb}/bin/xrdb -merge ~/.Xresources
       elif test -e ~/.Xdefaults; then