From 2c8c106aa0ad7de03d06396a3ce6d208eaad4acf Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Mon, 9 Feb 2026 22:00:16 +0800 Subject: [PATCH 1/3] fix: Choose SC variant of cjk fonts --- home/david/modules/programs/ghostty.nix | 2 +- home/david/modules/programs/waybar.nix | 2 +- home/david/modules/programs/zed.nix | 5 ++--- home/modules/programs/fish.nix | 12 ++++++++++++ nixos/configurations/Akun/stylix.nix | 2 +- nixos/configurations/Tytonidae/stylix.nix | 2 +- nixos/modules/gui/default.nix | 4 ++-- pkgs/nixvim/neovide.nix | 2 +- 8 files changed, 21 insertions(+), 10 deletions(-) diff --git a/home/david/modules/programs/ghostty.nix b/home/david/modules/programs/ghostty.nix index 482a37f..663fc8d 100644 --- a/home/david/modules/programs/ghostty.nix +++ b/home/david/modules/programs/ghostty.nix @@ -18,7 +18,7 @@ settings = { font-family = [ "MonoLisa" - "Source Han Sans" + "Source Han Sans SC" ]; font-size = lib.mkForce 17; theme = "Atom One Dark"; diff --git a/home/david/modules/programs/waybar.nix b/home/david/modules/programs/waybar.nix index 83301f2..66ead8e 100644 --- a/home/david/modules/programs/waybar.nix +++ b/home/david/modules/programs/waybar.nix @@ -159,7 +159,7 @@ in { settings = cfg.settings; style = '' * { - font-family: Libertinus Serif, Source Han Serif; + font-family: Libertinus Serif, Source Han Serif SC; font-weight: bold; font-size: 16px; } diff --git a/home/david/modules/programs/zed.nix b/home/david/modules/programs/zed.nix index e0088dd..ff565b6 100644 --- a/home/david/modules/programs/zed.nix +++ b/home/david/modules/programs/zed.nix @@ -31,7 +31,6 @@ in { "hurl" "idris2" "java" - "java-eclipse-jdtls" "kdl" "kotlin" "lua" @@ -111,9 +110,9 @@ in { buffer_font_size = 20; buffer_font_family = "MonoLisa"; buffer_font_fallback = [ - "Source Han Sans" + "Source Han Sans SC" ]; - ui_font_family = "Source Han Sans"; + ui_font_family = "Source Han Sans SC"; theme = "Catppuccin Latte"; helix_mode = true; }; diff --git a/home/modules/programs/fish.nix b/home/modules/programs/fish.nix index 9a4a1db..10233f8 100644 --- a/home/modules/programs/fish.nix +++ b/home/modules/programs/fish.nix @@ -39,6 +39,18 @@ in { fish_greeting = { body = ''''; }; + nani = { + body = + # fish + '' + for command in $argv + echo "$command:" + for path in $(which --all "$command" 2>/dev/null) + realpath $path + end + end + ''; + }; }; shellInitLast = # fish diff --git a/nixos/configurations/Akun/stylix.nix b/nixos/configurations/Akun/stylix.nix index e9c1218..3a17b5e 100644 --- a/nixos/configurations/Akun/stylix.nix +++ b/nixos/configurations/Akun/stylix.nix @@ -20,7 +20,7 @@ }; sansSerif = { package = pkgs.source-han-sans; - name = "Source Han Sans"; + name = "Source Han Sans SC"; }; monospace = { package = pkgs.maple-mono.NF-CN; diff --git a/nixos/configurations/Tytonidae/stylix.nix b/nixos/configurations/Tytonidae/stylix.nix index cf760a0..09abdcb 100644 --- a/nixos/configurations/Tytonidae/stylix.nix +++ b/nixos/configurations/Tytonidae/stylix.nix @@ -20,7 +20,7 @@ }; sansSerif = { package = pkgs.source-han-sans; - name = "Source Han Sans"; + name = "Source Han Sans SC"; }; monospace = { package = pkgs.maple-mono.NF-CN; diff --git a/nixos/modules/gui/default.nix b/nixos/modules/gui/default.nix index 4a7247a..d9934f4 100644 --- a/nixos/modules/gui/default.nix +++ b/nixos/modules/gui/default.nix @@ -71,11 +71,11 @@ in { defaultFonts = { serif = [ "Libertinus Serif" - "Source Han Serif" + "Source Han Serif SC" "Noto Serif CJK SC" ]; sansSerif = [ - "Source Han Sans" + "Source Han Sans SC" "Noto Sans CJK SC" ]; monospace = [ diff --git a/pkgs/nixvim/neovide.nix b/pkgs/nixvim/neovide.nix index 144670e..0202c70 100644 --- a/pkgs/nixvim/neovide.nix +++ b/pkgs/nixvim/neovide.nix @@ -3,7 +3,7 @@ #lua '' if vim.g.neovide then - vim.o.guifont = [[MonoLisa,Source Han Sans,Noto Color Emoji:h16]] + vim.o.guifont = [[MonoLisa,Source Han Sans SC,Noto Color Emoji:h16]] vim.g.neovide_opacity = 0.9 vim.g.linespace = 0.2 vim.g.neovide_text_gamma = 0.8 From e85da11b656784eec11969a07565639721604f17 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Tue, 10 Feb 2026 12:39:08 +0800 Subject: [PATCH 2/3] fix: Reformat code --- home/david/modules/programs/noctalia/settings.json | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/home/david/modules/programs/noctalia/settings.json b/home/david/modules/programs/noctalia/settings.json index d6b6bd0..d0db0e0 100644 --- a/home/david/modules/programs/noctalia/settings.json +++ b/home/david/modules/programs/noctalia/settings.json @@ -118,9 +118,7 @@ "drawerEnabled": true, "hidePassive": false, "id": "Tray", - "pinned": [ - "Fcitx" - ] + "pinned": ["Fcitx"] }, { "clockColor": "none", @@ -457,12 +455,7 @@ "autoHideMs": 2000, "overlayLayer": true, "backgroundOpacity": 1, - "enabledTypes": [ - 0, - 1, - 2, - 3 - ], + "enabledTypes": [0, 1, 2, 3], "monitors": [] }, "audio": { From 4b00734efee466ee951124589c3f1c237d8e94d4 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Tue, 10 Feb 2026 12:45:34 +0800 Subject: [PATCH 3/3] feat: Use oxfmt to reformat json/yaml/toml/markdown --- .oxfmtrc.json | 3 +++ .zed/settings.json | 32 ++++++++++++++++++++++ flake/perSystem.nix | 1 + pkgs/rime-all/default.custom.yaml | 36 +++++-------------------- treefmt.nix | 44 ++++++------------------------- 5 files changed, 50 insertions(+), 66 deletions(-) create mode 100644 .oxfmtrc.json diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..6c6a80e --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,3 @@ +{ + "ignorePatterns": ["_sources/*.json", "secrets/*.yaml"] +} diff --git a/.zed/settings.json b/.zed/settings.json index ff63d82..2f8a134 100644 --- a/.zed/settings.json +++ b/.zed/settings.json @@ -7,6 +7,38 @@ "arguments": ["-"] } } + }, + "JSON": { + "formatter": { + "external": { + "command": "oxfmt", + "arguments": ["--stdin-filepath", "{buffer_path}"] + } + } + }, + "Markdown": { + "formatter": { + "external": { + "command": "oxfmt", + "arguments": ["--stdin-filepath", "{buffer_path}"] + } + } + }, + "YAML": { + "formatter": { + "external": { + "command": "oxfmt", + "arguments": ["--stdin-filepath", "{buffer_path}"] + } + } + }, + "TOML": { + "formatter": { + "external": { + "command": "oxfmt", + "arguments": ["--stdin-filepath", "{buffer_path}"] + } + } } } } diff --git a/flake/perSystem.nix b/flake/perSystem.nix index c972461..7d2c42a 100644 --- a/flake/perSystem.nix +++ b/flake/perSystem.nix @@ -33,6 +33,7 @@ just nvfetcher alejandra + oxfmt lua-language-server ]; diff --git a/pkgs/rime-all/default.custom.yaml b/pkgs/rime-all/default.custom.yaml index bad6da4..4505e22 100644 --- a/pkgs/rime-all/default.custom.yaml +++ b/pkgs/rime-all/default.custom.yaml @@ -29,36 +29,12 @@ patch: - { when: has_menu, accept: minus, send: Page_Up } - { when: has_menu, accept: equal, send: Page_Down } - - { - when: always, - toggle: ascii_punct, - accept: Control+Shift+3, - } # 切换中英标点 - - { - when: always, - toggle: ascii_punct, - accept: Control+Shift+numbersign, - } # 切换中英标点 - - { - when: always, - toggle: traditionalization, - accept: Control+Shift+4, - } # 切换简繁 - - { - when: always, - toggle: traditionalization, - accept: Control+Shift+dollar, - } # 切换简繁 - - { - when: always, - toggle: full_shape, - accept: Control+Shift+5, - } # 切换全半角 - - { - when: always, - toggle: full_shape, - accept: Control+Shift+percent, - } # 切换全半角 + - { when: always, toggle: ascii_punct, accept: Control+Shift+3 } # 切换中英标点 + - { when: always, toggle: ascii_punct, accept: Control+Shift+numbersign } # 切换中英标点 + - { when: always, toggle: traditionalization, accept: Control+Shift+4 } # 切换简繁 + - { when: always, toggle: traditionalization, accept: Control+Shift+dollar } # 切换简繁 + - { when: always, toggle: full_shape, accept: Control+Shift+5 } # 切换全半角 + - { when: always, toggle: full_shape, accept: Control+Shift+percent } # 切换全半角 # 将小键盘 0~9 . 映射到主键盘,数字金额大写的 Lua 如 R1234.5678 可使用小键盘输入 - { accept: KP_0, send: 0, when: composing } diff --git a/treefmt.nix b/treefmt.nix index 3037b6b..3e00dd3 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -1,43 +1,18 @@ { - perSystem = { - pkgs, - lib, - ... - }: { + perSystem = {lib, ...}: { treefmt = { programs = { alejandra = { enable = true; excludes = ["_sources/*.nix"]; }; - biome = { + oxfmt = let + oxfmtConfig = with lib; + pipe ./.oxfmtrc.json [builtins.readFile builtins.fromJSON]; + in { enable = true; - includes = ["*.json"]; - excludes = ["_sources/*.json"]; - settings = { - formatter.indentStyle = "space"; - javascript.formatter.enabled = false; - css.formatter.enabled = false; - }; - }; - dprint = { - enable = true; - includes = [ - "*.md" - "*.toml" - "*.yaml" - ]; - excludes = ["secrets/*.yaml"]; - settings = { - plugins = pkgs.dprint-plugins.getPluginList ( - plugins: - with plugins; [ - dprint-plugin-toml - dprint-plugin-markdown - g-plane-pretty_yaml - ] - ); - }; + includes = ["*.json" "*.md" "*.toml" "*.yaml"]; + excludes = oxfmtConfig.ignorePatterns; }; just = { enable = true; @@ -45,10 +20,7 @@ }; typos = let config = with lib; - pipe ./.typos.toml [ - builtins.readFile - fromTOML - ]; + pipe ./.typos.toml [builtins.readFile fromTOML]; in { enable = true; includes = ["*"];