diff --git a/home/common/programs/ai-gui.nix b/home/common/programs/ai-gui.nix index 6958836..bcf18c5 100644 --- a/home/common/programs/ai-gui.nix +++ b/home/common/programs/ai-gui.nix @@ -8,7 +8,9 @@ let claude-desktop = pkgs.callPackage ../../../pkgs/claude-desktop/package.nix { inherit (config.custom.aiApps) deviceScaleFactor; }; - chatgpt = pkgs.callPackage ../../../pkgs/chatgpt/package.nix { }; + chatgpt = pkgs.callPackage ../../../pkgs/chatgpt/package.nix { + inherit (config.custom.aiApps) deviceScaleFactor; + }; t3-code = pkgs.callPackage ../../../pkgs/t3-code/package.nix { inherit (config.custom.aiApps) deviceScaleFactor; }; diff --git a/home/common/programs/claude/default.nix b/home/common/programs/claude/default.nix index a369389..38c2804 100644 --- a/home/common/programs/claude/default.nix +++ b/home/common/programs/claude/default.nix @@ -10,13 +10,13 @@ ./synthetic.nix ]; - # Shared UI-scale knob for the Electron AI desktop apps (Claude Desktop, T3 Code). + # Shared UI-scale knob for the Electron AI desktop apps (Claude Desktop, ChatGPT, T3 Code). # Set per-host (e.g. konishi's 4K@1x monitors want ~"1.5"); null = native scale. options.custom.aiApps.deviceScaleFactor = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; example = "1.5"; - description = "--force-device-scale-factor value for Claude Desktop and T3 Code."; + description = "--force-device-scale-factor value for Claude Desktop, ChatGPT, and T3 Code."; }; # OpenWhispr's GPU-accelerated local Whisper transcription (NVIDIA hosts diff --git a/pkgs/chatgpt/package.nix b/pkgs/chatgpt/package.nix index 719f86e..15fd991 100644 --- a/pkgs/chatgpt/package.nix +++ b/pkgs/chatgpt/package.nix @@ -41,6 +41,7 @@ libxfixes, libxrandr, xdg-utils, + deviceScaleFactor ? null, }: stdenv.mkDerivation (finalAttrs: { pname = "chatgpt"; @@ -128,7 +129,8 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper $out/lib/chatgpt/ChatGPT $out/bin/chatgpt \ "''${gappsWrapperArgs[@]}" \ --prefix PATH : ${lib.makeBinPath [ xdg-utils ]} \ - --add-flags "--ozone-platform=wayland" + --add-flags "--ozone-platform=wayland" \ + ${lib.optionalString (deviceScaleFactor != null) ''--add-flags "--force-device-scale-factor=${deviceScaleFactor}"''} substituteInPlace $out/share/applications/chatgpt.desktop \ --replace-fail "Exec=chatgpt %U" "Exec=$out/bin/chatgpt %U" runHook postInstall