forked from mirrors/nixpkgs
Merge pull request #222689 from K900/bye-dpi-2
nixos/hidpi: remove harder
This commit is contained in:
commit
fae7294cf5
|
@ -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}
|
||||
|
@ -260,11 +266,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.
|
||||
|
|
|
@ -7,6 +7,19 @@ This module generates a package containing configuration files and link it in /e
|
|||
Fontconfig reads files in folder name / file name order, so the number prepended to the configuration file name decide the order of parsing.
|
||||
Low number means high priority.
|
||||
|
||||
NOTE: Please take extreme care when adjusting the default settings of this module.
|
||||
People care a lot, and I mean A LOT, about their font rendering, and you will be
|
||||
The Person That Broke It if it changes in a way people don't like.
|
||||
|
||||
See prior art:
|
||||
- https://github.com/NixOS/nixpkgs/pull/194594
|
||||
- https://github.com/NixOS/nixpkgs/pull/222236
|
||||
- https://github.com/NixOS/nixpkgs/pull/222689
|
||||
|
||||
And do not repeat our mistakes.
|
||||
|
||||
- @K900, March 2023
|
||||
|
||||
*/
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
@ -218,6 +231,8 @@ let
|
|||
paths = cfg.confPackages;
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
|
||||
fontconfigNote = "Consider manually configuring fonts.fontconfig according to personal preference.";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
@ -229,6 +244,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.
|
||||
|
|
|
@ -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; };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue