{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.fonts.fontconfig;
in
{
meta.maintainers = [ maintainers.rycee ];
options = {
fonts.fontconfig = {
enableProfileFonts = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Configure fontconfig to discover fonts installed through
home.packages and
nix-env.
Note, this is only necessary on non-NixOS systems.
'';
};
};
};
config = mkIf cfg.enableProfileFonts {
xdg.configFile."fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
${config.home.profileDirectory}/lib/X11/fonts
${config.home.profileDirectory}/share/fonts
'';
};
}