diff --git a/README.md b/README.md index 983385a..eb57099 100644 --- a/README.md +++ b/README.md @@ -5,37 +5,26 @@ ## 快速开始 ```bash -# 1. 克隆仓库 -git clone https://git.furtherverse.com/imbytecat/archlinux-config.git -cd archlinux-config +curl -fsSL https://git.furtherverse.com/imbytecat/archlinux-config/raw/branch/main/install.sh | bash +``` -# 2. 运行 setup(安装 yay 和 dcli) -chmod +x setup.sh -./setup.sh +安装完成后: -# 3. 检查配置(可选) -cat ~/.config/arch-config/hosts/wsl.yaml - -# 4. 应用配置 +```bash +cd ~/.config/arch-config dcli sync ``` ## 配置说明 -- `arch-config/hosts/wsl.yaml` - WSL 配置 -- `arch-config/modules/` - 模块化包管理 -- `arch-config/files/` - 配置文件(自动同步) +- `hosts/wsl.yaml` - WSL 配置 +- `modules/` - 模块化包管理 +- `files/` - 配置文件(自动同步) ## 更新配置 ```bash -# 拉取最新配置 -cd ~/archlinux-config # 或你的 clone 目录 +cd ~/.config/arch-config git pull - -# 应用更新 dcli sync - -# 更新系统包 -dcli update ``` diff --git a/arch-config/config.yaml b/config.yaml similarity index 100% rename from arch-config/config.yaml rename to config.yaml diff --git a/arch-config/files/etc/pacman.d/mirrorlist b/files/etc/pacman.d/mirrorlist similarity index 100% rename from arch-config/files/etc/pacman.d/mirrorlist rename to files/etc/pacman.d/mirrorlist diff --git a/arch-config/files/home/.zshrc b/files/home/.zshrc similarity index 100% rename from arch-config/files/home/.zshrc rename to files/home/.zshrc diff --git a/arch-config/hosts/wsl.yaml b/hosts/wsl.yaml similarity index 100% rename from arch-config/hosts/wsl.yaml rename to hosts/wsl.yaml diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..011c0a4 --- /dev/null +++ b/install.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -euo pipefail + +REPO_URL="https://git.furtherverse.com/imbytecat/archlinux-config.git" +CONFIG_DIR="$HOME/.config/arch-config" + +echo "==> 更新系统..." +sudo pacman -Syu --noconfirm + +echo "==> 安装基础工具..." +sudo pacman -S --needed --noconfirm base-devel git + +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 +fi + +echo "==> 安装 dcli..." +yay -S --needed --noconfirm dcli-arch-git + +echo "==> 克隆配置仓库..." +if [ -d "$CONFIG_DIR" ]; then + echo "配置目录已存在,跳过克隆" +else + git clone "$REPO_URL" "$CONFIG_DIR" +fi + +echo "" +echo "✓ 安装完成!" +echo "" +echo "下一步:" +echo " cd ~/.config/arch-config" +echo " dcli sync" diff --git a/arch-config/modules/base.yaml b/modules/base.yaml similarity index 100% rename from arch-config/modules/base.yaml rename to modules/base.yaml diff --git a/arch-config/modules/dev-tools.yaml b/modules/dev-tools.yaml similarity index 100% rename from arch-config/modules/dev-tools.yaml rename to modules/dev-tools.yaml diff --git a/arch-config/modules/zsh.yaml b/modules/zsh.yaml similarity index 100% rename from arch-config/modules/zsh.yaml rename to modules/zsh.yaml diff --git a/setup.sh b/setup.sh deleted file mode 100755 index ca29093..0000000 --- a/setup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -euo pipefail - -REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -echo "==> 安装 yay..." -if ! command -v yay &> /dev/null; then - sudo pacman -S --needed --noconfirm base-devel git - rm -rf /tmp/yay - git clone https://aur.archlinux.org/yay.git /tmp/yay - cd /tmp/yay - makepkg -si --noconfirm -fi - -echo "==> 安装 dcli..." -yay -S --needed --noconfirm dcli-arch-git - -echo "==> 链接配置..." -rm -rf ~/.config/arch-config -ln -sf "$REPO_DIR/arch-config" ~/.config/arch-config - -echo "" -echo "✓ Bootstrap 完成!" -echo "" -echo "下一步:" -echo " 1. 检查配置: ~/.config/arch-config/" -echo " 2. 应用配置: dcli sync"