refactor: 从 dcli 迁移到 decman 声明式配置管理

- 新增 source.py 统一声明包、系统文件和 dotfiles
- 简化 install.sh,由 decman 接管系统文件和 locale 配置
- 移除 dcli 配置(config.yaml、hosts/、modules/、state/)
- 添加 pyproject.toml 和 uv.lock 用于开发环境类型提示
- 更新 README.md 和 AGENTS.md 适配 decman 工作流
This commit is contained in:
2026-03-26 10:31:07 +08:00
parent 34d4325f09
commit 56a2cc483f
16 changed files with 360 additions and 227 deletions
+19 -17
View File
@@ -17,34 +17,36 @@ else
git clone "$REPO_URL" "$CONFIG_DIR"
fi
echo "==> 配置系统文件..."
sudo cp "$CONFIG_DIR/files/etc/pacman.d/mirrorlist" /etc/pacman.d/mirrorlist
sudo cp "$CONFIG_DIR/files/etc/sudoers.d/10-wheel" /etc/sudoers.d/10-wheel
sudo chmod 440 /etc/sudoers.d/10-wheel
echo "==> 配置 locale..."
sudo sed -i 's/^#en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
sudo locale-gen
echo "LANG=en_US.UTF-8" | sudo tee /etc/locale.conf > /dev/null
echo "==> 更新系统..."
sudo pacman -Syu --noconfirm
echo "==> 安装基础工具..."
echo "==> 安装 base-devel..."
sudo pacman -S --needed --noconfirm base-devel
echo "==> 安装 yay..."
if ! command -v yay &> /dev/null; then
rm -rf /tmp/yay
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay
makepkg -si --noconfirm
(cd /tmp/yay && makepkg -si --noconfirm)
rm -rf /tmp/yay
fi
echo "==> 安装 dcli..."
yay -S --needed --noconfirm dcli-arch-git
echo "==> 安装 decman..."
yay -S --needed --noconfirm decman
echo "==> 应用系统配置..."
sudo decman --source "$CONFIG_DIR/source.py"
echo "==> 生成 locale..."
sudo locale-gen
echo "==> 设置默认 shell 为 zsh..."
if [ "$SHELL" != "$(which zsh)" ]; then
sudo chsh -s "$(which zsh)" "$USER"
fi
echo ""
echo "✓ 安装完成!"
echo "✓ 安装完成!重新登录以使用 zsh。"
echo ""
echo "下一步:运行 dcli sync 应用配置"
echo "后续更新配置"
echo " cd $CONFIG_DIR && git pull && sudo decman"