diff --git a/home/xin/calcite.nix b/home/xin/calcite.nix index e0b4693..3b3c4ea 100644 --- a/home/xin/calcite.nix +++ b/home/xin/calcite.nix @@ -78,6 +78,14 @@ in }; neovim = { enable = true; + font = { + normal = [ + "JetbrainsMono Nerd Font" + "Noto Sans Mono CJK SC" + "Ubuntu" + ]; + size = 12.0; + }; }; vscode = { enable = true; diff --git a/modules/home-manager/alacritty.nix b/modules/home-manager/alacritty.nix index afe00ea..84fac8c 100644 --- a/modules/home-manager/alacritty.nix +++ b/modules/home-manager/alacritty.nix @@ -21,7 +21,7 @@ in "alacritty-zellij" ]; }; - font.size = 10.0; + font.size = 12.0; window = { resize_increments = true; dynamic_padding = true; diff --git a/modules/home-manager/vim.nix b/modules/home-manager/vim.nix index 0709791..bd41ca5 100644 --- a/modules/home-manager/vim.nix +++ b/modules/home-manager/vim.nix @@ -5,9 +5,29 @@ ... }: let - inherit (lib) mkIf mkEnableOption getExe; + inherit (lib) + mkIf + mkEnableOption + getExe + types + attrsets + ; cfg = config.custom-hm.neovim; tomlFormat = pkgs.formats.toml { }; + fontItem = + with types; + either str (submodule { + options = { + family = { + type = str; + }; + style = { + type = nullOr str; + default = null; + }; + }; + }); + fontType = types.either fontItem (types.listOf fontItem); neovideConfig = { neovim-bin = getExe pkgs.nixvim; fork = true; @@ -17,6 +37,78 @@ in { options.custom-hm.neovim = { enable = mkEnableOption "neovim configurations"; + font = { + # Required options + normal = lib.mkOption { + type = fontType; + description = '' + The normal font description. Can be: + - A table with "family" (required) and "style" (optional). + - A string indicating the font family. + - An array of strings or tables as described above. + ''; + }; + + size = lib.mkOption { + type = lib.types.float; + description = "Required font size."; + }; + + # Optional options + bold = lib.mkOption { + type = types.nullOr fontType; + default = null; + description = '' + Optional bold font description. Can be: + - A table with "family" (optional) and "style" (optional). + - A string indicating the font family. + - An array of strings or tables as described above. + ''; + }; + + italic = lib.mkOption { + type = types.nullOr fontType; + default = null; + description = "Optional italic font description."; + }; + + bold_italic = lib.mkOption { + type = types.nullOr fontType; + default = null; + description = "Optional bold-italic font description."; + }; + + features = lib.mkOption { + type = types.nullOr (lib.types.attrsOf (lib.types.listOf lib.types.str)); + default = { }; + description = '' + Optional font features. A table where the key is the font family and + the value is a list of font features. Each feature can be: + - + (e.g., +ss01) + - - (e.g., -calt) + - = (e.g., ss02=2) + ''; + }; + + width = lib.mkOption { + type = types.nullOr types.float; + default = null; + description = "Optional font width."; + }; + + hinting = lib.mkOption { + type = types.nullOr types.str; + default = null; + description = "Optional font hinting (none, slight, medium, full)."; + }; + + edging = lib.mkOption { + type = types.nullOr types.str; + default = null; + description = "Optional font edging (none, antialiased, subpixel)."; + }; + + }; }; config = mkIf cfg.enable { home.packages = with pkgs; [ @@ -25,7 +117,12 @@ in ]; programs.neovim.enable = false; home.file.".config/neovide/config.toml" = { - source = tomlFormat.generate "neovide-config" neovideConfig; + source = tomlFormat.generate "neovide-config" ( + neovideConfig + // (attrsets.filterAttrsRecursive (n: v: v != null) { + font = cfg.font; + }) + ); }; }; } diff --git a/modules/home-manager/zellij.nix b/modules/home-manager/zellij.nix index be2d4fe..d925365 100644 --- a/modules/home-manager/zellij.nix +++ b/modules/home-manager/zellij.nix @@ -29,6 +29,7 @@ in unbind "Alt h" "Alt l" "Alt j" "Alt k" } unbind "Ctrl p" "Ctrl n" + unbind "Alt f" } ''; };