diff --git a/AGENTS.md b/AGENTS.md index 68e013c..bbcaebd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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) -├── files/ # System configuration files to deploy +├── system/ # System configuration files to deploy │ └── etc/ │ ├── pacman.d/mirrorlist │ └── sudoers.d/10-wheel -├── dotfiles/ # User dotfiles to deploy +├── home/ # User configuration files to deploy │ └── .zshrc └── scripts/ ├── 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.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( - source_file="./dotfiles/.zshrc", + source_file="./home/.zshrc", 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). -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`. @@ -196,15 +196,15 @@ decman.files[f"{HOME}/.zshrc"] = File( - Run `sudo decman` **Add a new system file**: -- Place the file in `files/` matching target path structure (e.g., `files/etc/foo.conf` → `/etc/foo.conf`) -- Add `decman.files["/etc/foo.conf"] = File(source_file="./files/etc/foo.conf")` to `source.py` +- 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="./system/etc/foo.conf")` to `source.py` - Run `sudo decman` **Add a new dotfile**: -- Place the file in `dotfiles/` -- Add `decman.files[f"{HOME}/.config/foo"] = File(source_file="./dotfiles/foo", owner=USERNAME)` to `source.py` +- Place the file in `home/` +- Add `decman.files[f"{HOME}/.config/foo"] = File(source_file="./home/foo", owner=USERNAME)` to `source.py` - Run `sudo decman` **Update an existing configuration file**: -- Edit the source file in `files/` or `dotfiles/` +- Edit the source file in `system/` or `home/` - Run `sudo decman` diff --git a/README.md b/README.md index aa8eed2..8f50f0e 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ cd ~/.config/arch-config && git pull && sudo decman ``` . ├── source.py # decman 主配置(包、系统文件、dotfiles) -├── files/ # 系统配置文件源 +├── system/ # 系统配置文件源 │ └── etc/ │ ├── pacman.d/mirrorlist │ └── sudoers.d/10-wheel -├── dotfiles/ # 用户配置文件源 +├── home/ # 用户配置文件源 │ └── .zshrc └── scripts/ ├── install.sh # 安装脚本(bootstrap → decman) @@ -58,6 +58,6 @@ cd ~/.config/arch-config && git pull && sudo decman ## 配置说明 - `source.py` — 所有声明集中在一个文件:pacman 包、AUR 包、系统文件、dotfiles -- `files/` — 需要部署到 `/etc/` 的系统配置文件,目录结构对应目标路径 -- `dotfiles/` — 需要部署到用户目录的配置文件 +- `system/` — 系统配置文件,目录结构对应目标路径(如 `system/etc/` → `/etc/`) +- `home/` — 用户配置文件,部署到 `~/` - `scripts/` — 一次性引导脚本,安装完成后由 `sudo decman` 接管日常管理 diff --git a/dotfiles/.zshrc b/home/.zshrc similarity index 100% rename from dotfiles/.zshrc rename to home/.zshrc diff --git a/source.py b/source.py index ccbda66..224a75a 100644 --- a/source.py +++ b/source.py @@ -57,11 +57,11 @@ decman.aur.ignored_packages |= {"yay"} # ── 系统文件(/etc/)────────────────────────────────────────── 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( - source_file="./files/etc/sudoers.d/10-wheel", + source_file="./system/etc/sudoers.d/10-wheel", permissions=0o440, ) @@ -70,8 +70,8 @@ decman.files["/etc/locale.conf"] = File(content="LANG=en_US.UTF-8\n") # 仅保留需要的 locale;修改后需手动执行 locale-gen decman.files["/etc/locale.gen"] = File(content="en_US.UTF-8 UTF-8\n") -# ── 用户 Dotfiles ──────────────────────────────────────────── +# ── 用户配置 ───────────────────────────────────────────────── decman.files[f"{HOME}/.zshrc"] = File( - source_file="./dotfiles/.zshrc", + source_file="./home/.zshrc", owner=USERNAME, ) diff --git a/files/etc/pacman.d/mirrorlist b/system/etc/pacman.d/mirrorlist similarity index 100% rename from files/etc/pacman.d/mirrorlist rename to system/etc/pacman.d/mirrorlist diff --git a/files/etc/sudoers.d/10-wheel b/system/etc/sudoers.d/10-wheel similarity index 100% rename from files/etc/sudoers.d/10-wheel rename to system/etc/sudoers.d/10-wheel