refactor: KISS cleanup — deduplicate shared config, merge thin files

- Extract fonts, fish.enable, openssh.enable to modules/shared/
- Centralize sshKeys in lib/ via specialArgs
- Merge nixos/base.nix + locale.nix into nixos/default.nix
- Merge home/theme.nix into home/default.nix
- Simplify homeManagerConfig, flake packages output
- Remove redundant vim/wget from NixOS system packages
- Update AGENTS.md to reflect new structure
This commit is contained in:
2026-04-13 22:25:55 +08:00
parent d7e0aaf798
commit be247ff3b9
12 changed files with 121 additions and 134 deletions
-19
View File
@@ -1,19 +0,0 @@
{ pkgs, ... }:
{
# ── System-essential packages ──────────────────────
# User-level tools live in home-manager (home/)
environment.systemPackages = with pkgs; [
curl
git
ghostty.terminfo
vim
wget
];
# ── Fonts ──────────────────────────────────────────
fonts.packages = with pkgs; [
maple-mono.NF-CN-unhinted
nerd-fonts.symbols-only
];
}
+19 -10
View File
@@ -1,26 +1,35 @@
{ pkgs, username, ... }:
{
pkgs,
username,
sshKeys,
...
}:
{
imports = [
./base.nix
./docker.nix
./locale.nix
];
# ── Default shell ──────────────────────────────────
programs.fish.enable = true;
# ── System-essential packages ──────────────────────
environment.systemPackages = with pkgs; [
curl
git
ghostty.terminfo
];
# ── SSH ──────────────────────────────────────────
services.openssh.enable = true;
# ── Locale / Timezone ──────────────────────────────
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [ "en_US.UTF-8/UTF-8" ];
};
time.timeZone = "Asia/Shanghai";
# ── Default user ───────────────────────────────────
users.users.${username} = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDRTOo48gzzRGT+bF9dzJCFJu61YgsQVONFtxU9kTPIg"
];
openssh.authorizedKeys.keys = sshKeys;
};
# ── sudo ───────────────────────────────────────────
-4
View File
@@ -8,8 +8,4 @@
environment.systemPackages = with pkgs; [
docker-compose
];
# WSL 环境下如使用 Docker Desktop,可改为:
# wsl.docker-desktop.enable = true;
# 并将上面的 virtualisation.docker.enable 设为 false
}
-10
View File
@@ -1,10 +0,0 @@
{ ... }:
{
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [ "en_US.UTF-8/UTF-8" ];
};
time.timeZone = "Asia/Shanghai";
}