mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
fontconfig: add fonts.fontconfig.extraConfigFiles option (#7754)
Co-authored-by: Tim Keller <tjk@tjkeller.xyz> Co-authored-by: Benedikt M. Rips <benedikt.rips@gmail.com>
This commit is contained in:
parent
75f97fcbe3
commit
fad8e3033e
4 changed files with 161 additions and 23 deletions
|
|
@ -22,4 +22,5 @@
|
|||
|
||||
fontconfig-default-rendering = ./default-rendering.nix;
|
||||
fontconfig-custom-rendering = ./custom-rendering.nix;
|
||||
fontconfig-extra-config-files = ./extra-config-files.nix;
|
||||
}
|
||||
|
|
|
|||
33
tests/modules/misc/fontconfig/extra-config-files.nix
Normal file
33
tests/modules/misc/fontconfig/extra-config-files.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
let
|
||||
sampleTextContent = "hello world";
|
||||
fcConfD = "home-files/.config/fontconfig/conf.d";
|
||||
in
|
||||
{
|
||||
fonts.fontconfig = {
|
||||
enable = true;
|
||||
configFile = {
|
||||
text-label-test = {
|
||||
enable = true;
|
||||
label = "sample-text-config";
|
||||
text = sampleTextContent;
|
||||
priority = 55;
|
||||
};
|
||||
source-nolabel-test = {
|
||||
enable = true;
|
||||
source = ./sample-extra-config.conf;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertDirectoryExists ${fcConfD}
|
||||
|
||||
assertFileExists ${fcConfD}/55-hm-sample-text-config.conf
|
||||
assertFileContent ${fcConfD}/55-hm-sample-text-config.conf \
|
||||
${builtins.toFile "sample-text-config" sampleTextContent}
|
||||
|
||||
assertFileExists ${fcConfD}/90-hm-source-nolabel-test.conf
|
||||
assertFileContent ${fcConfD}/90-hm-source-nolabel-test.conf \
|
||||
${./sample-extra-config.conf}
|
||||
'';
|
||||
}
|
||||
14
tests/modules/misc/fontconfig/sample-extra-config.conf
Normal file
14
tests/modules/misc/fontconfig/sample-extra-config.conf
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
|
||||
<fontconfig>
|
||||
<description>Disable anti-aliasing for Tamzen since it is a bitmap font</description>
|
||||
<match target="pattern">
|
||||
<test name="family" compare="eq" qual="any">
|
||||
<string>Tamzen</string>
|
||||
</test>
|
||||
<edit name="antialias" mode="assign">
|
||||
<bool>false</bool>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
||||
Loading…
Add table
Add a link
Reference in a new issue