2017-10-09 18:37:57 +02:00
|
|
|
{ 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
|
|
|
|
<varname>home.packages</varname> and
|
|
|
|
<command>nix-env</command>.
|
|
|
|
</para><para>
|
|
|
|
Note, this is only necessary on non-NixOS systems.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enableProfileFonts {
|
2017-10-24 18:30:35 +02:00
|
|
|
xdg.configFile."fontconfig/conf.d/10-nix-profile-fonts.conf".text = ''
|
2017-10-09 18:37:57 +02:00
|
|
|
<?xml version='1.0'?>
|
|
|
|
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
|
|
|
<fontconfig>
|
2018-07-29 18:15:50 +02:00
|
|
|
<dir>${config.home.profileDirectory}/lib/X11/fonts</dir>
|
|
|
|
<dir>${config.home.profileDirectory}/share/fonts</dir>
|
2017-10-09 18:37:57 +02:00
|
|
|
</fontconfig>
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|