From 1493848136785e4fcc542a22f52cd03a3160e325 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Thu, 21 Mar 2024 00:23:18 +0800 Subject: [PATCH] home/fonts: use symbols only nerd font --- home/applications/rofi/rofi/config.rasi | 2 +- .../common/graphical/home/fonts/default.nix | 45 +++++++++++-------- .../common/graphical/home/fonts/fonts.conf | 2 +- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/home/applications/rofi/rofi/config.rasi b/home/applications/rofi/rofi/config.rasi index 3758b3a..104c60b 100644 --- a/home/applications/rofi/rofi/config.rasi +++ b/home/applications/rofi/rofi/config.rasi @@ -16,7 +16,7 @@ configuration { @import "~/.config/rofi/colors.rasi" * { - font: "JetBrainsMono Nerd Font SemiBold 14"; + font: "JetBrains Mono SemiBold 14"; separatorcolor: transparent; border: 0; margin: 0; diff --git a/nixos/profiles/common/graphical/home/fonts/default.nix b/nixos/profiles/common/graphical/home/fonts/default.nix index 3cad736..f07b4c2 100644 --- a/nixos/profiles/common/graphical/home/fonts/default.nix +++ b/nixos/profiles/common/graphical/home/fonts/default.nix @@ -1,15 +1,29 @@ {pkgs, ...}: { - # Fontconfig + # WARN: I don't know fontconfig and I have no idea what am I doing. Please do not use as reference. xdg.configFile = { "fontconfig/fonts.conf".source = ./fonts.conf; - "fontconfig/conf.d/web-ui-fonts.conf".source = pkgs.fetchurl { + "fontconfig/conf.d/10-web-ui-fonts.conf".source = pkgs.fetchurl { url = "https://raw.githubusercontent.com/lilydjwg/dotconfig/1b22d4f0740bb5bbd7c65b6c468920775171b207/fontconfig/web-ui-fonts.conf"; hash = "sha256-A4DcV6HTW/IRxXN3NaI1GUfoFdalwgFLpCjgbWENdZU="; }; - "fontconfig/conf.d/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="; + "fontconfig/conf.d/10-source-han-for-noto-cjk.conf".source = pkgs.substitute { + src = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/lilydjwg/dotconfig/1b22d4f0740bb5bbd7c65b6c468920775171b207/fontconfig/source-han-for-noto-cjk.conf"; + hash = "sha256-jcdDr5VW1qZXbApgfT5FZgxonpRnLs9AY0QagfdL8ic="; + }; + substitutions = [ + "--replace-warn" + "Source Han Sans" + "Source Han Sans VF" + "--replace-warn" + "Source Han Serif" + "Source Han Serif VF" + ]; + }; + "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="; }; }; @@ -26,23 +40,18 @@ }; # HM managed fonts + # + # 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. fonts.fontconfig.enable = true; home.packages = with pkgs; [ - ### Inter + (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) inter - - ### JetBrains Mono Nerd Font - (nerdfonts.override {fonts = ["JetBrainsMono"];}) - - ### Adobe Source Han - # 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. - source-han-sans-vf-otf - source-han-serif-vf-otf - - ### Noto Fonts + jetbrains-mono noto-fonts noto-fonts-color-emoji + source-han-sans-vf-otf + source-han-serif-vf-otf ]; } diff --git a/nixos/profiles/common/graphical/home/fonts/fonts.conf b/nixos/profiles/common/graphical/home/fonts/fonts.conf index a6acc6e..51cbe55 100644 --- a/nixos/profiles/common/graphical/home/fonts/fonts.conf +++ b/nixos/profiles/common/graphical/home/fonts/fonts.conf @@ -37,7 +37,7 @@ monospace - JetBrainsMono Nerd Font + JetBrains Mono Source Han Sans SC VF Noto Color Emoji