about summary refs log tree commit diff
path: root/modules/nixos/x11.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/nixos/x11.nix44
1 files changed, 32 insertions, 12 deletions
diff --git a/modules/nixos/x11.nix b/modules/nixos/x11.nix
index f2d850b..b1bca8f 100644
--- a/modules/nixos/x11.nix
+++ b/modules/nixos/x11.nix
@@ -1,6 +1,7 @@
 {
   config,
   lib,
+  pkgs,
   ...
 }:
 with lib; let
@@ -12,26 +13,25 @@ in {
     nixfiles.modules.fonts.enable = true;
 
     hm = {
-      home.sessionVariables = with config.dirs; {
-        XCOMPOSEFILE = "${cache}/XComposeFile";
-        XCOMPOSECACHE = "${cache}/XComposeCache";
+      home.sessionVariables = {
+        XCOMPOSEFILE = pkgs.writeText "XCompose" ''
+          include "${pkgs.xorg.libX11}/share/X11/locale/en_US.UTF-8/Compose"
+        '';
+        XCOMPOSECACHE = "${config.dirs.cache}/libx11/compose";
       };
 
-      xsession.scriptPath = ".xinitrc";
-
       xresources.properties =
         (let
           font = with config.fontScheme.monospaceFont; "${family}:style=${style}:size=${toString size}";
         in {
           "*.font" = font;
 
-          "Xft.antialias" = 1;
-          "Xft.autohint" = 0;
-          "Xft.dpi" = 96;
-          "Xft.hinting" = 1;
-          "Xft.hintstyle" = "hintslight";
-          "Xft.lcdfilter" = "lcddefault";
-          "Xft.rgba" = "rgb";
+          "Xft.antialias" = mkDefault 1;
+          "Xft.autohint" = mkDefault 0;
+          "Xft.hinting" = mkDefault 1;
+          "Xft.hintstyle" = mkDefault "hintslight";
+          "Xft.lcdfilter" = mkDefault "lcddefault";
+          "Xft.rgba" = mkDefault "rgb";
         })
         // (with config.colourScheme; {
           "*.color0" = black;
@@ -54,6 +54,26 @@ in {
           "*.background" = background;
           "*.foreground" = foreground;
         });
+
+      services.xsettingsd = {
+        enable = true;
+        # https://codeberg.org/derat/xsettingsd#settings
+        settings = let
+          xprop = config.hm.xresources.properties;
+        in {
+          "Net/CursorBlink" = 1;
+          "Net/CursorBlinkTime" = 1200;
+          "Net/DndDragThreshold" = 0;
+          "Net/DoubleClickDistance" = 5;
+          "Net/DoubleClickTime" = 250;
+          "Net/EnableEventSounds" = 1;
+          "Net/EnableInputFeedbackSounds" = 1;
+          "Xft/Antialias" = xprop."Xft.antialias";
+          "Xft/HintStyle" = xprop."Xft.hintstyle";
+          "Xft/Hinting" = xprop."Xft.hinting";
+          "Xft/RGBA" = xprop."Xft.rgba";
+        };
+      };
     };
 
     services.xserver = {

Consider giving Nix/NixOS a try! <3