From 2937154e38ab3f589273358c0beac4ff8849fc0e Mon Sep 17 00:00:00 2001 From: Joshua Yuen Date: Fri, 11 Sep 2026 22:35:32 -0400 Subject: [PATCH] Add display scaling option for GDK applications --- hosts/laptop/default.nix | 1 + modules/core/user.nix | 1 + modules/homes/hyprland/hyprland.nix | 2 ++ modules/options/default.nix | 1 + modules/options/display.nix | 14 ++++++++++++++ 5 files changed, 19 insertions(+) create mode 100644 modules/options/display.nix diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 65a8469..555cbcd 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -16,4 +16,5 @@ modules.gpg.signingKey = "0x530DA0331EFE99F5"; modules.gnomeBoxes.enable = true; + modules.display.scale = 2; } diff --git a/modules/core/user.nix b/modules/core/user.nix index 2feed34..7399f9e 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -28,6 +28,7 @@ in users.${username} = { imports = [ ../../homes/${username}/home.nix ]; modules.gpg.signingKey = config.modules.gpg.signingKey; + modules.display.scale = config.modules.display.scale; }; }; diff --git a/modules/homes/hyprland/hyprland.nix b/modules/homes/hyprland/hyprland.nix index cd6ec6b..48f9be3 100644 --- a/modules/homes/hyprland/hyprland.nix +++ b/modules/homes/hyprland/hyprland.nix @@ -7,6 +7,7 @@ with lib; let cfg = config.modules.hyprland; + displayCfg = config.modules.display; in { wayland.windowManager.hyprland = { @@ -56,6 +57,7 @@ in "XDG_CURRENT_DESKTOP, Hyprland" "XDG_SESSION_DESKTOP, Hyprland" "XDG_SESSION_TYPE, wayland" + "GDK_SCALE, ${toString displayCfg.scale}" ]; xwayland = { diff --git a/modules/options/default.nix b/modules/options/default.nix index cbb1bee..0469250 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -4,6 +4,7 @@ { imports = [ ./discord.nix + ./display.nix ./displayManager.nix ./gnomeBoxes.nix ./gpg.nix diff --git a/modules/options/display.nix b/modules/options/display.nix new file mode 100644 index 0000000..9f13a11 --- /dev/null +++ b/modules/options/display.nix @@ -0,0 +1,14 @@ +{ + lib, + ... +}: +with lib; +{ + options.modules.display = { + scale = mkOption { + type = types.int; + default = 1; + description = "Display Scaling"; + }; + }; +}