fix(nixos): make Firefox scale host-specific

This commit is contained in:
2026-09-05 07:35:30 -04:00
parent 4a3eaea150
commit 1f49f1d63e
2 changed files with 15 additions and 2 deletions

View File

@@ -46,6 +46,7 @@
modules.shell.pi.enable = true; modules.shell.pi.enable = true;
modules.desktop.enable = true; modules.desktop.enable = true;
modules.desktop.apps.firefox.uiScale = "1.25";
modules.desktop.apps.obsidian.enable = true; modules.desktop.apps.obsidian.enable = true;
modules.desktop.apps.steam.enable = true; modules.desktop.apps.steam.enable = true;

View File

@@ -12,7 +12,19 @@ let
firefoxAddons = inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; firefoxAddons = inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system};
in in
{ {
options.modules.desktop.apps.firefox.enable = lib.mkEnableOption "Firefox as the desktop browser"; options.modules.desktop.apps.firefox = {
enable = lib.mkEnableOption "Firefox as the desktop browser";
uiScale = lib.mkOption {
type = lib.types.str;
default = "1.0";
description = ''
Firefox UI and page scale, passed to `layout.css.devPixelsPerPx`.
Override it on hosts that need a larger browser scale, such as small
high-DPI laptop panels.
'';
};
};
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home-manager.users.${user} = hm: { home-manager.users.${user} = hm: {
@@ -70,7 +82,7 @@ in
# whole chrome while point-sized apps stay put. # whole chrome while point-sized apps stay put.
# A shade under that brings it into line without dropping to true # A shade under that brings it into line without dropping to true
# 1:1, which reads too small at this DPI. # 1:1, which reads too small at this DPI.
"layout.css.devPixelsPerPx" = "1.25"; "layout.css.devPixelsPerPx" = cfg.uiScale;
# Auto-enable the sideloaded Firefox Color add-on carrying the Nord # Auto-enable the sideloaded Firefox Color add-on carrying the Nord
# chrome theme, which Firefox otherwise leaves disabled. # chrome theme, which Firefox otherwise leaves disabled.