nixos/fonts: use vf only

This commit is contained in:
Guanran Wang 2024-04-05 16:41:07 +08:00
parent 4aa34b2a0f
commit 77b051fd6f
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
2 changed files with 22 additions and 4 deletions

View file

@ -44,11 +44,29 @@
# The reason I use Source Han instead of Noto CJK, # The reason I use Source Han instead of Noto CJK,
# is because I heard from #archlinux-cn, Adobe packages font better. # is because I heard from #archlinux-cn, Adobe packages font better.
# You can 100% use noto-fonts-cjk-{sans,serif} if you prefer consistency/other reason. # You can 100% use noto-fonts-cjk-{sans,serif} if you prefer consistency/other reason.
#
# Using VF to reduce closure size:
# Version 1579 -> 1580:
# home-manager: -10.4 KiB
# inter: -12695.6 KiB
# jetbrains-mono: -7621.0 KiB
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
inter (inter.overrideAttrs {
jetbrains-mono installPhase = ''
runHook preInstall
install -Dm644 -t $out/share/fonts/truetype/ InterVariable*.ttf
runHook postInstall
'';
})
(jetbrains-mono.overrideAttrs {
installPhase = ''
runHook preInstall
install -Dm644 -t $out/share/fonts/truetype/ fonts/variable/*.ttf
runHook postInstall
'';
})
noto-fonts noto-fonts
noto-fonts-color-emoji noto-fonts-color-emoji
source-han-sans-vf-otf source-han-sans-vf-otf

View file

@ -28,7 +28,7 @@
<alias binding="strong"> <alias binding="strong">
<family>sans-serif</family> <family>sans-serif</family>
<prefer> <prefer>
<family>Inter</family> <family>Inter Variable</family>
<family>Source Han Sans SC VF</family> <family>Source Han Sans SC VF</family>
<family>Noto Color Emoji</family> <family>Noto Color Emoji</family>
</prefer> </prefer>
@ -46,7 +46,7 @@
<alias binding="strong"> <alias binding="strong">
<family>system-ui</family> <family>system-ui</family>
<prefer> <prefer>
<family>Inter</family> <family>Inter Variable</family>
<family>Source Han Sans SC VF</family> <family>Source Han Sans SC VF</family>
<family>Noto Color Emoji</family> <family>Noto Color Emoji</family>
</prefer> </prefer>