From 3ad8fc39637bfca3f589228baaf879c9944f2b49 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 4 Nov 2023 20:49:54 +0800 Subject: [PATCH] nixos: move font packages to home-manager --- nixos/packages/graphical/default.nix | 1 - nixos/packages/graphical/fonts.nix | 47 ------------------- .../guanranwang/home-manager/nixos/fonts.nix | 29 ++++++++++++ .../home-manager/nixos/presets/desktop.nix | 1 + 4 files changed, 30 insertions(+), 48 deletions(-) delete mode 100755 nixos/packages/graphical/fonts.nix create mode 100644 users/guanranwang/home-manager/nixos/fonts.nix diff --git a/nixos/packages/graphical/default.nix b/nixos/packages/graphical/default.nix index e135de3..c3e2bea 100755 --- a/nixos/packages/graphical/default.nix +++ b/nixos/packages/graphical/default.nix @@ -2,7 +2,6 @@ imports = [ ./display-server - ./fonts.nix ./gnome-keyring.nix ./graphical.nix ./polkit.nix diff --git a/nixos/packages/graphical/fonts.nix b/nixos/packages/graphical/fonts.nix deleted file mode 100755 index b694893..0000000 --- a/nixos/packages/graphical/fonts.nix +++ /dev/null @@ -1,47 +0,0 @@ -{pkgs, ...}: { - # Fonts - fonts = { - fontDir.enable = true; - packages = with pkgs; [ - ### Noto Fonts - noto-fonts - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-emoji - - ### Source Han - source-han-sans - source-han-serif - source-han-mono - - ### CJK - #wqy_zenhei # weird font shape, noto sans cjk is a better alternative - #wqy_microhei - - ### Sans - inter - roboto - - ### Monospace - fira-code - jetbrains-mono - (nerdfonts.override { - fonts = [ - "FiraCode" - "JetBrainsMono" - "NerdFontsSymbolsOnly" - ]; - }) - ]; - fontconfig = { - cache32Bit = true; - defaultFonts = { - emoji = ["Noto Color Emoji"]; - serif = ["Noto Serif"]; - sansSerif = ["Inter" "Noto Sans"]; - monospace = ["JetBrainsMono Nerd Font" "JetBrains Mono" "FiraCode Nerd Font" "Fira Code" "Noto Sans Mono"]; - }; - }; - # fontconfig is too limited here, and appling it globally is **bad**, use Home Manager instead - }; -} diff --git a/users/guanranwang/home-manager/nixos/fonts.nix b/users/guanranwang/home-manager/nixos/fonts.nix new file mode 100644 index 0000000..912e48c --- /dev/null +++ b/users/guanranwang/home-manager/nixos/fonts.nix @@ -0,0 +1,29 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + ### Noto Fonts + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-emoji + + ### Source Han + source-han-sans + source-han-serif + source-han-mono + + ### Sans + inter + roboto + + ### Monospace + fira-code + jetbrains-mono + (nerdfonts.override { + fonts = [ + "FiraCode" + "JetBrainsMono" + "NerdFontsSymbolsOnly" + ]; + }) + ]; +} diff --git a/users/guanranwang/home-manager/nixos/presets/desktop.nix b/users/guanranwang/home-manager/nixos/presets/desktop.nix index 07270d5..829a98b 100644 --- a/users/guanranwang/home-manager/nixos/presets/desktop.nix +++ b/users/guanranwang/home-manager/nixos/presets/desktop.nix @@ -4,6 +4,7 @@ ../home.nix ../dotfiles.nix + ../fonts.nix ../i18n.nix ../sway.nix ../waybar.nix