about summary refs log tree commit diff
path: root/users
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-05-09T22·17+0000
committertazjin <tazjin@tvl.su>2022-05-10T15·00+0000
commitc07f11bd806da0ca5caf5055d446e8a348d4b6d8 (patch)
tree729c33df9decc38153c83948d46f2d372ae953a4 /users
parent302b754d7adb2bfc3783ca61572d1f197f7f2b5e (diff)
feat(tazjin/modules): Add HiDPI module r/4049
Change-Id: Ib690ec25ebe10af4924735553a8315609b7cbc4e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5566
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'users')
-rw-r--r--users/tazjin/nixos/modules/hidpi.nix17
-rw-r--r--users/tazjin/nixos/zamalek/default.nix1
2 files changed, 18 insertions, 0 deletions
diff --git a/users/tazjin/nixos/modules/hidpi.nix b/users/tazjin/nixos/modules/hidpi.nix
new file mode 100644
index 000000000000..942798112a43
--- /dev/null
+++ b/users/tazjin/nixos/modules/hidpi.nix
@@ -0,0 +1,17 @@
+# Configuration for machines with HiDPI displays, which are a total
+# mess, of course.
+{ ... }:
+
+{
+  # Expose a variable to all programs that might be interested in the
+  # screen settings to do conditional initialisation (mostly for Emacs).
+  environment.variables.HIDPI_SCREEN = "true";
+
+  # Ensure a larger font size in early boot stage.
+  hardware.video.hidpi.enable = true;
+
+  # Bump DPI across the board.
+  # TODO(tazjin): This should actually be set per monitor, but I
+  # haven't yet figured out the right interface for doing that.
+  services.xserver.dpi = 192;
+}
diff --git a/users/tazjin/nixos/zamalek/default.nix b/users/tazjin/nixos/zamalek/default.nix
index 487436f41d58..7b94d8723c47 100644
--- a/users/tazjin/nixos/zamalek/default.nix
+++ b/users/tazjin/nixos/zamalek/default.nix
@@ -15,6 +15,7 @@ in
   imports = [
     (usermod "desktop.nix")
     (usermod "fonts.nix")
+    (usermod "hidpi.nix")
     (usermod "home-config.nix")
     (usermod "laptop.nix")
     (usermod "persistence.nix")