refactor: 重命名 files/ 为 system/、dotfiles/ 为 home/
This commit is contained in:
@@ -13,11 +13,11 @@ This is a declarative Arch Linux configuration repository managed by `decman` (D
|
|||||||
```
|
```
|
||||||
.
|
.
|
||||||
├── source.py # decman main configuration (packages, system files, dotfiles)
|
├── source.py # decman main configuration (packages, system files, dotfiles)
|
||||||
├── files/ # System configuration files to deploy
|
├── system/ # System configuration files to deploy
|
||||||
│ └── etc/
|
│ └── etc/
|
||||||
│ ├── pacman.d/mirrorlist
|
│ ├── pacman.d/mirrorlist
|
||||||
│ └── sudoers.d/10-wheel
|
│ └── sudoers.d/10-wheel
|
||||||
├── dotfiles/ # User dotfiles to deploy
|
├── home/ # User configuration files to deploy
|
||||||
│ └── .zshrc
|
│ └── .zshrc
|
||||||
└── scripts/
|
└── scripts/
|
||||||
├── install.sh # Bootstrap script (git → yay → decman → first sync)
|
├── install.sh # Bootstrap script (git → yay → decman → first sync)
|
||||||
@@ -140,11 +140,11 @@ decman.pacman.packages |= {"git", "neovim", "zsh"}
|
|||||||
decman.aur.packages |= {"decman", "bun"}
|
decman.aur.packages |= {"decman", "bun"}
|
||||||
|
|
||||||
decman.files["/etc/pacman.d/mirrorlist"] = File(
|
decman.files["/etc/pacman.d/mirrorlist"] = File(
|
||||||
source_file="./files/etc/pacman.d/mirrorlist",
|
source_file="./system/etc/pacman.d/mirrorlist",
|
||||||
)
|
)
|
||||||
|
|
||||||
decman.files[f"{HOME}/.zshrc"] = File(
|
decman.files[f"{HOME}/.zshrc"] = File(
|
||||||
source_file="./dotfiles/.zshrc",
|
source_file="./home/.zshrc",
|
||||||
owner=USERNAME,
|
owner=USERNAME,
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
@@ -172,9 +172,9 @@ decman.files[f"{HOME}/.zshrc"] = File(
|
|||||||
|
|
||||||
2. **Pacman vs AUR**: Packages must be correctly categorized into `decman.pacman.packages` (official repos) and `decman.aur.packages` (AUR).
|
2. **Pacman vs AUR**: Packages must be correctly categorized into `decman.pacman.packages` (official repos) and `decman.aur.packages` (AUR).
|
||||||
|
|
||||||
3. **System files**: Files in `files/` are copied (not symlinked) to system locations by decman. Use `File(source_file=..., permissions=...)` with correct permissions.
|
3. **System files**: Files in `system/` are copied (not symlinked) to system locations by decman. Use `File(source_file=..., permissions=...)` with correct permissions.
|
||||||
|
|
||||||
4. **Dotfiles**: Files in `dotfiles/` are copied to user home by decman. Use `File(source_file=..., owner=USERNAME)`.
|
4. **User config**: Files in `home/` are copied to user home by decman. Use `File(source_file=..., owner=USERNAME)`.
|
||||||
|
|
||||||
5. **No dry-run**: decman does not have a `--dry-run` option. Review changes in `source.py` before running `sudo decman`.
|
5. **No dry-run**: decman does not have a `--dry-run` option. Review changes in `source.py` before running `sudo decman`.
|
||||||
|
|
||||||
@@ -196,15 +196,15 @@ decman.files[f"{HOME}/.zshrc"] = File(
|
|||||||
- Run `sudo decman`
|
- Run `sudo decman`
|
||||||
|
|
||||||
**Add a new system file**:
|
**Add a new system file**:
|
||||||
- Place the file in `files/` matching target path structure (e.g., `files/etc/foo.conf` → `/etc/foo.conf`)
|
- Place the file in `system/` matching target path structure (e.g., `system/etc/foo.conf` → `/etc/foo.conf`)
|
||||||
- Add `decman.files["/etc/foo.conf"] = File(source_file="./files/etc/foo.conf")` to `source.py`
|
- Add `decman.files["/etc/foo.conf"] = File(source_file="./system/etc/foo.conf")` to `source.py`
|
||||||
- Run `sudo decman`
|
- Run `sudo decman`
|
||||||
|
|
||||||
**Add a new dotfile**:
|
**Add a new dotfile**:
|
||||||
- Place the file in `dotfiles/`
|
- Place the file in `home/`
|
||||||
- Add `decman.files[f"{HOME}/.config/foo"] = File(source_file="./dotfiles/foo", owner=USERNAME)` to `source.py`
|
- Add `decman.files[f"{HOME}/.config/foo"] = File(source_file="./home/foo", owner=USERNAME)` to `source.py`
|
||||||
- Run `sudo decman`
|
- Run `sudo decman`
|
||||||
|
|
||||||
**Update an existing configuration file**:
|
**Update an existing configuration file**:
|
||||||
- Edit the source file in `files/` or `dotfiles/`
|
- Edit the source file in `system/` or `home/`
|
||||||
- Run `sudo decman`
|
- Run `sudo decman`
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ cd ~/.config/arch-config && git pull && sudo decman
|
|||||||
```
|
```
|
||||||
.
|
.
|
||||||
├── source.py # decman 主配置(包、系统文件、dotfiles)
|
├── source.py # decman 主配置(包、系统文件、dotfiles)
|
||||||
├── files/ # 系统配置文件源
|
├── system/ # 系统配置文件源
|
||||||
│ └── etc/
|
│ └── etc/
|
||||||
│ ├── pacman.d/mirrorlist
|
│ ├── pacman.d/mirrorlist
|
||||||
│ └── sudoers.d/10-wheel
|
│ └── sudoers.d/10-wheel
|
||||||
├── dotfiles/ # 用户配置文件源
|
├── home/ # 用户配置文件源
|
||||||
│ └── .zshrc
|
│ └── .zshrc
|
||||||
└── scripts/
|
└── scripts/
|
||||||
├── install.sh # 安装脚本(bootstrap → decman)
|
├── install.sh # 安装脚本(bootstrap → decman)
|
||||||
@@ -58,6 +58,6 @@ cd ~/.config/arch-config && git pull && sudo decman
|
|||||||
## 配置说明
|
## 配置说明
|
||||||
|
|
||||||
- `source.py` — 所有声明集中在一个文件:pacman 包、AUR 包、系统文件、dotfiles
|
- `source.py` — 所有声明集中在一个文件:pacman 包、AUR 包、系统文件、dotfiles
|
||||||
- `files/` — 需要部署到 `/etc/` 的系统配置文件,目录结构对应目标路径
|
- `system/` — 系统配置文件,目录结构对应目标路径(如 `system/etc/` → `/etc/`)
|
||||||
- `dotfiles/` — 需要部署到用户目录的配置文件
|
- `home/` — 用户配置文件,部署到 `~/`
|
||||||
- `scripts/` — 一次性引导脚本,安装完成后由 `sudo decman` 接管日常管理
|
- `scripts/` — 一次性引导脚本,安装完成后由 `sudo decman` 接管日常管理
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ decman.aur.ignored_packages |= {"yay"}
|
|||||||
|
|
||||||
# ── 系统文件(/etc/)──────────────────────────────────────────
|
# ── 系统文件(/etc/)──────────────────────────────────────────
|
||||||
decman.files["/etc/pacman.d/mirrorlist"] = File(
|
decman.files["/etc/pacman.d/mirrorlist"] = File(
|
||||||
source_file="./files/etc/pacman.d/mirrorlist",
|
source_file="./system/etc/pacman.d/mirrorlist",
|
||||||
)
|
)
|
||||||
|
|
||||||
decman.files["/etc/sudoers.d/10-wheel"] = File(
|
decman.files["/etc/sudoers.d/10-wheel"] = File(
|
||||||
source_file="./files/etc/sudoers.d/10-wheel",
|
source_file="./system/etc/sudoers.d/10-wheel",
|
||||||
permissions=0o440,
|
permissions=0o440,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -70,8 +70,8 @@ decman.files["/etc/locale.conf"] = File(content="LANG=en_US.UTF-8\n")
|
|||||||
# 仅保留需要的 locale;修改后需手动执行 locale-gen
|
# 仅保留需要的 locale;修改后需手动执行 locale-gen
|
||||||
decman.files["/etc/locale.gen"] = File(content="en_US.UTF-8 UTF-8\n")
|
decman.files["/etc/locale.gen"] = File(content="en_US.UTF-8 UTF-8\n")
|
||||||
|
|
||||||
# ── 用户 Dotfiles ────────────────────────────────────────────
|
# ── 用户配置 ─────────────────────────────────────────────────
|
||||||
decman.files[f"{HOME}/.zshrc"] = File(
|
decman.files[f"{HOME}/.zshrc"] = File(
|
||||||
source_file="./dotfiles/.zshrc",
|
source_file="./home/.zshrc",
|
||||||
owner=USERNAME,
|
owner=USERNAME,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user