Switch to a raw file for fontconfig.
This commit is contained in:
parent
14e6e78aee
commit
69098488f6
@ -44,6 +44,10 @@
|
||||
boot.kernelPackages = pkgs.linuxPackages_6_11;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
services.getty = {
|
||||
autologinUser = "talexander"; # I use full disk encryption so the user password is irrelevant.
|
||||
autologinOnce = true;
|
||||
};
|
||||
users.mutableUsers = false;
|
||||
users.users.talexander = {
|
||||
isNormalUser = true;
|
||||
|
@ -9,115 +9,17 @@
|
||||
imports = [ ];
|
||||
|
||||
fonts = {
|
||||
enableDefaultPackages = true;
|
||||
enableDefaultPackages = false;
|
||||
packages = with pkgs; [
|
||||
cascadia-code
|
||||
source-sans-pro
|
||||
source-serif-pro
|
||||
noto-fonts-color-emoji
|
||||
];
|
||||
|
||||
fontconfig = {
|
||||
localConf = ''
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<!-- reject all bitmap fonts, with the exception of 'terminus' -->
|
||||
<selectfont>
|
||||
<!-- <acceptfont> -->
|
||||
<!-- <pattern> -->
|
||||
<!-- <patelt name="family"> <string>Terminus</string> </patelt> -->
|
||||
<!-- </pattern> -->
|
||||
<!-- </acceptfont> -->
|
||||
<rejectfont>
|
||||
<pattern>
|
||||
<patelt name="scalable"> <bool>false</bool> </patelt>
|
||||
</pattern>
|
||||
</rejectfont>
|
||||
<rejectfont>
|
||||
<!-- You don't want ghostscript fonts in your web browsing because of annoying ligatures like ffi -->
|
||||
<glob>/usr/share/fonts/gsfonts/*</glob>
|
||||
</rejectfont>
|
||||
</selectfont>
|
||||
|
||||
<!-- preferred aliases -->
|
||||
<alias>
|
||||
<family>serif</family>
|
||||
<prefer>
|
||||
<family>Source Serif Pro</family>
|
||||
<family>Source Sans Pro</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
|
||||
<!-- preferred aliases -->
|
||||
<alias>
|
||||
<family>sans-serif</family>
|
||||
<prefer>
|
||||
<family>Source Sans Pro</family>
|
||||
<family>Source Serif Pro</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
|
||||
<!-- preferred aliases -->
|
||||
<alias>
|
||||
<family>monospace</family>
|
||||
<prefer>
|
||||
<family>Cascadia Mono</family>
|
||||
<family>Cascadia Code</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
|
||||
|
||||
<!-- Screw it. Force Liberation Mono to be source code pro. -->
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Liberation Mono</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
||||
</match>
|
||||
|
||||
<!-- Dejavu Sans Mono keeps coming back when I query "monospace". Doesn't happen when I'm using Souce Code Pro but does happen with cascadia... force it to cascadia -->
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>monospace</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
||||
</match>
|
||||
|
||||
<!-- Disable ligatures in monospace fonts. -->
|
||||
<match target="font">
|
||||
<test name="family" compare="eq" ignore-blanks="true">
|
||||
<string>Cascadia Code</string>
|
||||
</test>
|
||||
<edit name="fontfeatures" mode="append">
|
||||
<string>liga off</string>
|
||||
<string>dlig off</string>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
<!-- Font Display Settings -->
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="rgba" >
|
||||
<const>rgb</const>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="hinting" >
|
||||
<bool>true</bool>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="hintstyle" >
|
||||
<const>hintslight</const>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="antialias" >
|
||||
<bool>true</bool>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="lcdfilter" >
|
||||
<const>lcddefault</const>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
||||
'';
|
||||
localConf = (builtins.readFile ./files/fonts.conf);
|
||||
useEmbeddedBitmaps = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
99
nix/configuration/roles/fonts/files/fonts.conf
Normal file
99
nix/configuration/roles/fonts/files/fonts.conf
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<!-- reject all bitmap fonts, with the exception of 'terminus' -->
|
||||
<selectfont>
|
||||
<!-- <acceptfont> -->
|
||||
<!-- <pattern> -->
|
||||
<!-- <patelt name="family"> <string>Terminus</string> </patelt> -->
|
||||
<!-- </pattern> -->
|
||||
<!-- </acceptfont> -->
|
||||
<rejectfont>
|
||||
<pattern>
|
||||
<patelt name="scalable"> <bool>false</bool> </patelt>
|
||||
</pattern>
|
||||
</rejectfont>
|
||||
<rejectfont>
|
||||
<!-- You don't want ghostscript fonts in your web browsing because of annoying ligatures like ffi -->
|
||||
<glob>/usr/share/fonts/gsfonts/*</glob>
|
||||
</rejectfont>
|
||||
</selectfont>
|
||||
|
||||
<!-- preferred aliases -->
|
||||
<alias>
|
||||
<family>serif</family>
|
||||
<prefer>
|
||||
<family>Source Serif Pro</family>
|
||||
<family>Source Sans Pro</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
|
||||
<!-- preferred aliases -->
|
||||
<alias>
|
||||
<family>sans-serif</family>
|
||||
<prefer>
|
||||
<family>Source Sans Pro</family>
|
||||
<family>Source Serif Pro</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
|
||||
<!-- preferred aliases -->
|
||||
<alias>
|
||||
<family>monospace</family>
|
||||
<prefer>
|
||||
<family>Cascadia Mono</family>
|
||||
<family>Cascadia Code</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
|
||||
|
||||
<!-- Screw it. Force Liberation Mono to be source code pro. -->
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Liberation Mono</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
||||
</match>
|
||||
|
||||
<!-- Dejavu Sans Mono keeps coming back when I query "monospace". Doesn't happen when I'm using Souce Code Pro but does happen with cascadia... force it to cascadia -->
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>monospace</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
||||
</match>
|
||||
|
||||
<!-- Disable ligatures in monospace fonts. -->
|
||||
<match target="font">
|
||||
<test name="family" compare="eq" ignore-blanks="true">
|
||||
<string>Cascadia Code</string>
|
||||
</test>
|
||||
<edit name="fontfeatures" mode="append">
|
||||
<string>liga off</string>
|
||||
<string>dlig off</string>
|
||||
</edit>
|
||||
</match>
|
||||
|
||||
<!-- Font Display Settings -->
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="rgba" >
|
||||
<const>rgb</const>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="hinting" >
|
||||
<bool>true</bool>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="hintstyle" >
|
||||
<const>hintslight</const>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="antialias" >
|
||||
<bool>true</bool>
|
||||
</edit>
|
||||
</match>
|
||||
<match target="font" >
|
||||
<edit mode="assign" name="lcdfilter" >
|
||||
<const>lcddefault</const>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
Loading…
x
Reference in New Issue
Block a user