重构项目结构:扁平化配置并支持 curl 一键安装
- 将 arch-config/ 内容移至仓库根目录 - setup.sh 重命名为 install.sh - 脚本改为自动 clone 仓库到 ~/.config/arch-config - 新增 pacman -Syu 系统更新步骤 - README 简化为 curl 一行安装
This commit is contained in:
@@ -5,37 +5,26 @@
|
|||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. 克隆仓库
|
curl -fsSL https://git.furtherverse.com/imbytecat/archlinux-config/raw/branch/main/install.sh | bash
|
||||||
git clone https://git.furtherverse.com/imbytecat/archlinux-config.git
|
```
|
||||||
cd archlinux-config
|
|
||||||
|
|
||||||
# 2. 运行 setup(安装 yay 和 dcli)
|
安装完成后:
|
||||||
chmod +x setup.sh
|
|
||||||
./setup.sh
|
|
||||||
|
|
||||||
# 3. 检查配置(可选)
|
```bash
|
||||||
cat ~/.config/arch-config/hosts/wsl.yaml
|
cd ~/.config/arch-config
|
||||||
|
|
||||||
# 4. 应用配置
|
|
||||||
dcli sync
|
dcli sync
|
||||||
```
|
```
|
||||||
|
|
||||||
## 配置说明
|
## 配置说明
|
||||||
|
|
||||||
- `arch-config/hosts/wsl.yaml` - WSL 配置
|
- `hosts/wsl.yaml` - WSL 配置
|
||||||
- `arch-config/modules/` - 模块化包管理
|
- `modules/` - 模块化包管理
|
||||||
- `arch-config/files/` - 配置文件(自动同步)
|
- `files/` - 配置文件(自动同步)
|
||||||
|
|
||||||
## 更新配置
|
## 更新配置
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 拉取最新配置
|
cd ~/.config/arch-config
|
||||||
cd ~/archlinux-config # 或你的 clone 目录
|
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
# 应用更新
|
|
||||||
dcli sync
|
dcli sync
|
||||||
|
|
||||||
# 更新系统包
|
|
||||||
dcli update
|
|
||||||
```
|
```
|
||||||
|
|||||||
Executable
+36
@@ -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"
|
||||||
@@ -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"
|
|
||||||
Reference in New Issue
Block a user