Files
archlinux-config/scripts/install.sh
T
imbytecat 56a2cc483f 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 工作流
2026-03-26 10:31:07 +08:00

53 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
REPO_URL="https://git.furtherverse.com/imbytecat/archlinux-config.git"
CONFIG_DIR="$HOME/.config/arch-config"
echo "==> 安装 git..."
sudo pacman -S --needed --noconfirm git
echo "==> 克隆配置仓库..."
if [ -d "$CONFIG_DIR/.git" ]; then
echo "配置仓库已存在:$CONFIG_DIR,跳过克隆"
elif [ -e "$CONFIG_DIR" ]; then
echo "目标路径已存在且不是 git 仓库:$CONFIG_DIR"
exit 1
else
git clone "$REPO_URL" "$CONFIG_DIR"
fi
echo "==> 更新系统..."
sudo pacman -Syu --noconfirm
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)
rm -rf /tmp/yay
fi
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 "✓ 安装完成!重新登录以使用 zsh。"
echo ""
echo "后续更新配置:"
echo " cd $CONFIG_DIR && git pull && sudo decman"