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:
+49
-9
@@ -1,16 +1,56 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
inputs,
|
||||
username,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./shell.nix
|
||||
./git.nix
|
||||
inputs.catppuccin.homeManagerModules.catppuccin
|
||||
./shell
|
||||
./dev
|
||||
./theme.nix
|
||||
];
|
||||
|
||||
home.stateVersion = "24.11";
|
||||
home = {
|
||||
username = username;
|
||||
homeDirectory =
|
||||
if pkgs.stdenv.isDarwin then "/Users/${username}" else "/home/${username}";
|
||||
stateVersion = "24.11";
|
||||
};
|
||||
|
||||
# ── mise 配置 ──
|
||||
xdg.configFile."mise/config.toml".text = ''
|
||||
[settings]
|
||||
trusted_config_paths = ["/"]
|
||||
'';
|
||||
# ── User-level packages ────────────────────────────
|
||||
home.packages = with pkgs; [
|
||||
# Modern CLI replacements
|
||||
dust # du
|
||||
duf # df
|
||||
procs # ps
|
||||
sd # sed
|
||||
xh # curl/httpie
|
||||
jq # JSON
|
||||
yq # YAML
|
||||
|
||||
# System info
|
||||
fastfetch
|
||||
tealdeer # tldr
|
||||
|
||||
# File management
|
||||
trash-cli
|
||||
|
||||
# Terminal multiplexer (alternative)
|
||||
zellij
|
||||
|
||||
# Nix tools
|
||||
nix-output-monitor # nom — better nix build output
|
||||
nvd # nix version diff
|
||||
nh # nix helper (nixos-rebuild wrapper)
|
||||
|
||||
# Misc
|
||||
micro # simple editor fallback
|
||||
];
|
||||
|
||||
# XDG directories
|
||||
xdg.enable = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user