mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
parent
b772f53acb
commit
0927405a37
8 changed files with 131 additions and 29 deletions
|
@ -27,9 +27,11 @@ with lib;
|
|||
|
||||
config = mkIf config.fonts.enableFontConfig {
|
||||
|
||||
# Bring in the default (upstream) fontconfig configuration.
|
||||
# Fontconfig 2.10 backward compatibility
|
||||
|
||||
# Bring in the default (upstream) fontconfig configuration, only for fontconfig 2.10
|
||||
environment.etc."fonts/fonts.conf".source =
|
||||
pkgs.makeFontsConf { fontDirectories = config.fonts.fonts; };
|
||||
pkgs.makeFontsConf { fontconfig = pkgs.fontconfig_210; fontDirectories = config.fonts.fonts; };
|
||||
|
||||
environment.etc."fonts/conf.d/00-nixos.conf".text =
|
||||
''
|
||||
|
@ -47,6 +49,27 @@ with lib;
|
|||
</fontconfig>
|
||||
'';
|
||||
|
||||
# Versioned fontconfig > 2.10. Only specify font directories.
|
||||
|
||||
environment.etc."fonts/${pkgs.fontconfig.configVersion}/conf.d/00-nixos.conf".text =
|
||||
''
|
||||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
|
||||
<!-- Set the default hinting style to "slight". -->
|
||||
<match target="font">
|
||||
<edit mode="assign" name="hintstyle">
|
||||
<const>hintslight</const>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
<!-- Font directories -->
|
||||
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
|
||||
|
||||
</fontconfig>
|
||||
'';
|
||||
|
||||
environment.systemPackages = [ pkgs.fontconfig ];
|
||||
|
||||
};
|
||||
|
|
|
@ -13,14 +13,6 @@ with lib;
|
|||
type = types.listOf types.path;
|
||||
example = literalExample "[ pkgs.dejavu_fonts ]";
|
||||
description = "List of primary font paths.";
|
||||
apply = list: list ++
|
||||
[ # - the user's current profile
|
||||
"~/.nix-profile/lib/X11/fonts"
|
||||
"~/.nix-profile/share/fonts"
|
||||
# - the default profile
|
||||
"/nix/var/nix/profiles/default/lib/X11/fonts"
|
||||
"/nix/var/nix/profiles/default/share/fonts"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue