nixos/hidpi: remove harder

We can't agree on what the right settings are (see #222236), so let's make the users choose.
This commit is contained in:
K900 2023-03-23 12:37:35 +03:00
parent c9183f5905
commit 8454084ffc
3 changed files with 11 additions and 33 deletions

View File

@ -179,6 +179,12 @@ In addition to numerous new and upgraded packages, this release has the followin
- conntrack helper autodetection has been removed from kernels 6.0 and up upstream, and an assertion was added to ensure things don't silently stop working. Migrate your configuration to assign helpers explicitly or use an older LTS kernel branch as a temporary workaround.
- The catch-all `hardware.video.hidpi.enable` option was removed. Users on high density displays may want to:
- Set `services.xserver.upscaleDefaultCursor` to upscale the default X11 cursor for higher resolutions
- Adjust settings under `fonts.fontconfig` according to preference
- Adjust `console.font` according to preference, though the kernel will generally choose a reasonably sized font
- The `baget` package and module was removed due to being unmaintained.
## Other Notable Changes {#sec-release-23.05-notable-changes}
@ -258,11 +264,6 @@ In addition to numerous new and upgraded packages, this release has the followin
[headscale's example configuration](https://github.com/juanfont/headscale/blob/main/config-example.yaml)
can be directly written as attribute-set in Nix within this option.
- The `hardware.video.hidpi.enable` was renamed to `fonts.optimizeForVeryHighDPI` to be consistent with what it actually does.
They disable by default: antialiasing, hinting and LCD filter for subpixel rendering. They can be overridden if you experience problems with font rendering.
On Xorg, the default cursor is upscaled.
Please see the documentation for the new option to decide if you want to keep it enabled.
- `nixos/lib/make-disk-image.nix` can now mutate EFI variables, run user-provided EFI firmware or variable templates. This is now extensively documented in the NixOS manual.
- `services.grafana` listens only on localhost by default again. This was changed to upstreams default of `0.0.0.0` by accident in the freeform setting conversion.

View File

@ -218,6 +218,8 @@ let
paths = cfg.confPackages;
ignoreCollisions = true;
};
fontconfigNote = "Consider manually configuring fonts.fontconfig according to personal preference.";
in
{
imports = [
@ -229,6 +231,8 @@ in
(mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "")
(mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "")
(mkRemovedOptionModule [ "fonts" "fontconfig" "dpi" ] "Use display server-specific options")
(mkRemovedOptionModule [ "hardware" "video" "hidpi" "enable" ] fontconfigNote)
(mkRemovedOptionModule [ "fonts" "optimizeForVeryHighDPI" ] fontconfigNote)
] ++ lib.forEach [ "enable" "substitutions" "preset" ]
(opt: lib.mkRemovedOptionModule [ "fonts" "fontconfig" "ultimate" "${opt}" ] ''
The fonts.fontconfig.ultimate module and configuration is obsolete.

View File

@ -13,13 +13,10 @@ let
pkgs.unifont
pkgs.noto-fonts-emoji
];
in
{
imports = [
(mkRemovedOptionModule [ "fonts" "enableCoreFonts" ] "Use fonts.fonts = [ pkgs.corefonts ]; instead.")
(mkRenamedOptionModule [ "hardware" "video" "hidpi" "enable" ] [ "fonts" "optimizeForVeryHighDPI" ])
];
options = {
@ -42,33 +39,9 @@ in
and families and reasonable coverage of Unicode.
'';
};
optimizeForVeryHighDPI = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Optimize configuration for very high-density (>200 DPI) displays:
- disable subpixel anti-aliasing
- disable hinting
- automatically upscale the default X11 cursor
'';
};
};
};
config = mkMerge [
{ fonts.fonts = mkIf cfg.enableDefaultFonts defaultFonts; }
(mkIf cfg.optimizeForVeryHighDPI {
services.xserver.upscaleDefaultCursor = mkDefault true;
# Conforms to the recommendation in fonts/fontconfig.nix
# for > 200DPI.
fonts.fontconfig = {
antialias = mkDefault false;
hinting.enable = mkDefault false;
subpixel.lcdfilter = mkDefault "none";
};
})
];
config = { fonts.fonts = mkIf cfg.enableDefaultFonts defaultFonts; };
}