flake/hosts/aristotle/graphical/home/fonts/default.nix

72 lines
2.5 KiB
Nix
Raw Normal View History

2023-11-25 09:02:50 +00:00
{pkgs, ...}: {
2024-03-20 16:23:18 +00:00
# WARN: I don't know fontconfig and I have no idea what am I doing. Please do not use as reference.
2023-11-25 09:02:50 +00:00
xdg.configFile = {
2024-02-18 17:20:16 +00:00
"fontconfig/fonts.conf".source = ./fonts.conf;
2024-03-20 16:23:18 +00:00
"fontconfig/conf.d/10-web-ui-fonts.conf".source = pkgs.fetchurl {
2023-12-07 06:16:51 +00:00
url = "https://raw.githubusercontent.com/lilydjwg/dotconfig/1b22d4f0740bb5bbd7c65b6c468920775171b207/fontconfig/web-ui-fonts.conf";
2023-11-25 09:02:50 +00:00
hash = "sha256-A4DcV6HTW/IRxXN3NaI1GUfoFdalwgFLpCjgbWENdZU=";
};
2024-06-14 23:25:48 +00:00
"fontconfig/conf.d/10-source-han-for-noto-cjk.conf".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/lilydjwg/dotconfig/1b22d4f0740bb5bbd7c65b6c468920775171b207/fontconfig/source-han-for-noto-cjk.conf";
hash = "sha256-jcdDr5VW1qZXbApgfT5FZgxonpRnLs9AY0QagfdL8ic=";
postFetch = ''
substitutionInPlace $out \
--replace-warn "Source Han Sans" "Source Han Sans VF" \
--replace-warn "Source Han Serif" "Source Han Serif VF"
'';
2024-03-20 16:23:18 +00:00
};
2024-06-14 23:25:48 +00:00
2024-03-20 16:23:18 +00:00
"fontconfig/conf.d/10-nerd-font-symbols.conf".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/${pkgs.nerdfonts.version}/10-nerd-font-symbols.conf";
hash = "sha256-XwJMkcDtGlI+LFMrjCl/gicAnoBWnq3p9adrmieNZwU=";
2023-11-25 09:02:50 +00:00
};
};
2024-02-18 17:20:16 +00:00
# Make GTK listen to fontconfig
2023-12-03 12:01:38 +00:00
dconf.settings = {
"org/gnome/desktop/wm/preferences" = {
2024-06-23 06:08:16 +00:00
"titlebar-font" = "Sans Bold 11";
2023-12-03 12:01:38 +00:00
};
"org/gnome/desktop/interface" = {
2024-06-23 06:08:16 +00:00
"font-name" = "Sans 11";
"document-font-name" = "Sans 11";
"monospace-font-name" = "Monospace 10";
2023-12-03 12:01:38 +00:00
};
};
2024-02-18 17:20:16 +00:00
# HM managed fonts
2024-03-20 16:23:18 +00:00
#
# The reason I use Source Han instead of Noto CJK,
# 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.
2024-04-05 08:41:07 +00:00
#
# Using VF to reduce closure size:
# Version 1579 -> 1580:
# home-manager: -10.4 KiB
# inter: -12695.6 KiB
# jetbrains-mono: -7621.0 KiB
2024-02-18 17:20:16 +00:00
fonts.fontconfig.enable = true;
2023-11-25 09:02:50 +00:00
home.packages = with pkgs; [
2024-03-20 16:23:18 +00:00
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
2024-04-05 08:41:07 +00:00
(inter.overrideAttrs {
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
'';
})
2023-11-25 09:02:50 +00:00
noto-fonts
noto-fonts-color-emoji
2024-03-20 16:23:18 +00:00
source-han-sans-vf-otf
source-han-serif-vf-otf
2023-11-25 09:02:50 +00:00
];
}