refactor: 重构为多平台多用户架构,全面提升终端体验

- 新增 lib/ 辅助函数(mkNixos/mkDarwin/mkHome),消除硬编码
- 拆分 modules/ 为 nixos/darwin/shared 三层,支持跨平台共享
- 重构 home/ 为 shell/dev/theme 子模块,工具全部迁入用户级
- 深度配置 Tmux/FZF/Atuin/Bat/Eza/Btop/Lazygit/Starship
- 添加 Catppuccin Mocha 统一主题、Nerd Fonts 声明式管理
- 新增 homeConfigurations 输出,支持非 NixOS 系统直装
- 新增 nix-darwin 输入,预留 macOS 扩展路径
- 新增 overlays/ 和 pkgs/ 自定义包基础设施
- 修正 nix-darwin URL(LnL7 → nix-darwin org)
This commit is contained in:
2026-04-03 19:54:17 +08:00
parent 92c6535945
commit e92c7aee31
31 changed files with 827 additions and 391 deletions
+7
View File
@@ -0,0 +1,7 @@
{
imports = [
./git.nix
./languages.nix
./neovim.nix
];
}
+59
View File
@@ -0,0 +1,59 @@
{ ... }:
{
programs.git = {
enable = true;
# user.name / user.email: set per-user via git config or ~/.zshrc.local
# git config --global user.name "Your Name"
# git config --global user.email "your@email.com"
delta = {
enable = true;
options = {
navigate = true;
side-by-side = true;
line-numbers = true;
hyperlinks = true;
};
};
extraConfig = {
# Internal Git server (skip SSL verification)
http."https://202.127.0.42:32443".sslVerify = false;
credential.helper = "store";
merge.conflictstyle = "zdiff3";
pull.rebase = true;
push.autoSetupRemote = true;
init.defaultBranch = "main";
rerere.enabled = true;
diff.algorithm = "histogram";
core.autocrlf = "input";
};
};
# ── Lazygit ──────────────────────────────────────────
programs.lazygit = {
enable = true;
settings = {
gui = {
nerdFontsVersion = "3";
showBottomLine = false;
};
git.paging = {
pager = "delta --paging=never";
};
update.method = "never";
disableStartupPopups = true;
};
};
# ── GitHub CLI ───────────────────────────────────────
programs.gh = {
enable = true;
settings = {
git_protocol = "ssh";
};
};
}
+41
View File
@@ -0,0 +1,41 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
# ── Language runtimes ──
nodejs
go
bun
# ── Package management / version management ──
mise
uv
# ── LSP servers ──
bash-language-server
gopls
typescript-language-server
yaml-language-server
vue-language-server
dockerfile-language-server-nodejs
lua-language-server
nil # Nix LSP
# ── Linter / Formatter ──
biome
ruff
shellcheck
shfmt
nixfmt-rfc-style # nix formatter
stylua
# ── Code intelligence ──
ast-grep
];
# ── mise config ──────────────────────────────────────
xdg.configFile."mise/config.toml".text = ''
[settings]
trusted_config_paths = ["/"]
'';
}
+24
View File
@@ -0,0 +1,24 @@
{ pkgs, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
withNodeJs = true;
withPython3 = true;
};
# ── Neovim distro configuration ──
# Option A: LazyVim / NvChad / AstroNvim via xdg.configFile
# xdg.configFile."nvim" = {
# source = ./nvim-config;
# recursive = true;
# };
#
# Option B: NixVim (fully declarative)
# Add to flake.nix inputs:
# nixvim.url = "github:nix-community/nixvim";
# Then configure here.
}