fontconfig: document defaulting behavior on NixOS

'fonts.fontconfig.enable' is, according to the documentation, disabled
by default. However, when Home Manager is installed as a NixOS submodule
and 'home-manager.useUserPackages' is enabled, it defaults to NixOS'
'fonts.fontconfig.enable'. This commit makes this behaviour transparent.

Closes #3966.
This commit is contained in:
Benedikt Rips
2026-05-16 17:09:27 +02:00
committed by Matthieu Coudron
parent 08c9d01457
commit a2c0bcaff4
2 changed files with 10 additions and 5 deletions

View File

@@ -72,11 +72,13 @@ in
type = lib.types.bool;
default = false;
description = ''
Whether to enable fontconfig configuration. This will, for
example, allow fontconfig to discover fonts and
configurations installed through
{var}`home.packages` and
{command}`nix-env`.
Whether to enable fontconfig configuration. This will, for example,
allow fontconfig to discover fonts and configurations installed through
{var}`home.packages` and {command}`nix-env`.
If Home Manager is installed as a NixOS submodule and
{var}`home-manager.useUserPackages` is enabled, this option defaults to the
value of NixOS' {var}`fonts.fontconfig.enable`.
'';
};

View File

@@ -79,6 +79,9 @@ in
config = {
# The per-user directory inside /etc/profiles is not known by
# fontconfig by default.
#
# When changing the following line, remember to reflect these
# changes in the description of 'fonts.fontconfig.enable'!
fonts.fontconfig.enable = lib.mkDefault (cfg.useUserPackages && config.fonts.fontconfig.enable);
# Inherit glibcLocales setting from NixOS.