mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
fontconfig: enable config files by default
This commit makes the `fonts.fontconfig.configFile.<name>.enable` option true by default which matches the behaviour of `home.file` and the like.
This commit is contained in:
committed by
Austin Horstman
parent
07c723c3fe
commit
c0436bc028
@@ -16,11 +16,35 @@ let
|
||||
|
||||
inherit (config.home) profileDirectory;
|
||||
|
||||
globalConfig = config;
|
||||
fontConfigFileType = lib.types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
enable = lib.mkEnableOption "Whether this font config file should be generated.";
|
||||
enable = lib.mkOption {
|
||||
description = ''
|
||||
Whether this file should be generated. This option allows specific
|
||||
files to be disabled.
|
||||
'';
|
||||
type = lib.types.bool;
|
||||
inherit
|
||||
(lib.hm.deprecations.mkStateVersionOptionDefault {
|
||||
inherit (globalConfig.home) stateVersion;
|
||||
since = "26.11";
|
||||
optionPath = [
|
||||
"fonts"
|
||||
"fontconfig"
|
||||
"configFile"
|
||||
name
|
||||
"enable"
|
||||
];
|
||||
legacy.value = false;
|
||||
current.value = true;
|
||||
})
|
||||
default
|
||||
defaultText
|
||||
;
|
||||
};
|
||||
text = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.lines;
|
||||
default = null;
|
||||
|
||||
@@ -6,4 +6,6 @@
|
||||
fontconfig-default-rendering = ./default-rendering.nix;
|
||||
fontconfig-custom-rendering = ./custom-rendering.nix;
|
||||
fontconfig-extra-config-files = ./extra-config-files.nix;
|
||||
|
||||
fontconfig-old-default-configFile-toggle = ./old-default-configFile-toggle.nix;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,53 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
sampleTextContent = "hello world";
|
||||
fcConfD = "home-files/.config/fontconfig/conf.d";
|
||||
sampleText = "hello world";
|
||||
sampleSource = builtins.toFile "fontconfig-source" ''
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
...
|
||||
</fontconfig>
|
||||
'';
|
||||
in
|
||||
{
|
||||
home.stateVersion = lib.trivial.release;
|
||||
|
||||
fonts.fontconfig = {
|
||||
enable = true;
|
||||
configFile = {
|
||||
text-label-test = {
|
||||
enable = true;
|
||||
label = "sample-text-config";
|
||||
text = sampleTextContent;
|
||||
priority = 55;
|
||||
disabled = {
|
||||
enable = false;
|
||||
text = "";
|
||||
};
|
||||
source-nolabel-test = {
|
||||
enable = true;
|
||||
source = ./sample-extra-config.conf;
|
||||
label = {
|
||||
label = "custom_label";
|
||||
text = "";
|
||||
};
|
||||
priority = {
|
||||
priority = 37;
|
||||
text = "";
|
||||
};
|
||||
text.text = sampleText;
|
||||
source.source = sampleSource;
|
||||
};
|
||||
};
|
||||
|
||||
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}
|
||||
assertPathNotExists ${fcConfD}/90-hm-disabled.conf
|
||||
|
||||
assertFileExists ${fcConfD}/90-hm-source-nolabel-test.conf
|
||||
assertFileContent ${fcConfD}/90-hm-source-nolabel-test.conf \
|
||||
${./sample-extra-config.conf}
|
||||
assertFileExists ${fcConfD}/90-hm-custom_label.conf
|
||||
|
||||
assertFileExists ${fcConfD}/37-hm-priority.conf
|
||||
|
||||
assertFileExists ${fcConfD}/90-hm-text.conf
|
||||
assertFileContent ${fcConfD}/90-hm-text.conf \
|
||||
${builtins.toFile "sample-text-config" sampleText}
|
||||
|
||||
assertFileExists ${fcConfD}/90-hm-source.conf
|
||||
assertFileContent ${fcConfD}/90-hm-source.conf ${sampleSource}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
let
|
||||
fcConfD = "home-files/.config/fontconfig/conf.d";
|
||||
in
|
||||
{
|
||||
home.stateVersion = "26.05"; # <= 26.11
|
||||
|
||||
fonts.fontconfig = {
|
||||
enable = true;
|
||||
configFile.implicitly-disabled.text = "foo";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists ${fcConfD}/10-hm-fonts.conf
|
||||
assertFileExists ${fcConfD}/52-hm-default-fonts.conf
|
||||
|
||||
assertPathNotExists ${fcConfD}/90-hm-implicitly-disabled.conf
|
||||
'';
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user