diff --git a/CLAUDE.md b/CLAUDE.md index c375572..d948d7a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ Reproduzierbares Arch-Linux-Setup basierend auf archinstall + Post-Install-Autom ## Projektstruktur -- `config/` — archinstall-Konfiguration (inkl. custom-commands die das Repo nach /opt/moonarch klonen) +- `config/` — archinstall-Konfiguration (inkl. custom-commands die das Repo nach /opt/moonarch klonen, root-owned) - `scripts/` — Post-Install- und Helper-Scripts - `packages/` — Paketlisten (offiziell + AUR), getrennt gepflegt - `defaults/` — XDG-Configs, Shell-Config, Helper-Binaries, greetd/moongreet-Config, Wallpaper diff --git a/DECISIONS.md b/DECISIONS.md new file mode 100644 index 0000000..6518b99 --- /dev/null +++ b/DECISIONS.md @@ -0,0 +1,13 @@ +# Decisions + +## 2026-03-29 – /opt/moonarch stays root-owned, no chown to user +- **Who**: Dominik, Ragnar +- **Why**: Multi-user system — chown to UID 1000 locks out other users from moonarch-update +- **Tradeoffs**: sudo required for git operations in update.sh vs. simpler user-owned repo +- **How**: Repo stays at /opt/moonarch owned by root:root. update.sh uses `sudo git` for fetch/pull. All scripts already use sudo for system-level operations, so this is consistent. + +## 2026-03-29 – Add transform.sh for existing Arch+Wayland systems +- **Who**: Dominik, Ragnar +- **Why**: Users with existing Arch+Wayland setups should be able to adopt Moonarch without reinstalling +- **Tradeoffs**: Hard overwrite of all configs (user + system) vs. selective/merge approach — chose hard overwrite for simplicity and consistency +- **How**: New transform.sh with pre-flight summary, backup, DM conflict resolution, and --dry-run flag. Shared helpers extracted to lib.sh. diff --git a/README.md b/README.md index 37e0793..510640b 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,6 @@ Transform converts your system to Moonarch without reinstalling. ```bash # Clone the repo sudo git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch -sudo chown -R $(whoami):$(whoami) /opt/moonarch # Preview what will happen (no changes made) /opt/moonarch/scripts/transform.sh --dry-run diff --git a/config/user_configuration.json b/config/user_configuration.json index 18f680f..69472c8 100644 --- a/config/user_configuration.json +++ b/config/user_configuration.json @@ -70,7 +70,6 @@ "timezone": "Europe/Berlin", "custom-commands": [ - "git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch", - "chown -R 1000:1000 /opt/moonarch" + "git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch" ] } diff --git a/scripts/update.sh b/scripts/update.sh index 4ee782d..a273fda 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -15,17 +15,17 @@ check_not_root log "=== Update Moonarch repo ===" cd "$PROJECT_DIR" -if git rev-parse --is-inside-work-tree &>/dev/null; then - LOCAL=$(git rev-parse HEAD) - git fetch origin - REMOTE=$(git rev-parse @{u} 2>/dev/null || echo "$LOCAL") +if sudo git rev-parse --is-inside-work-tree &>/dev/null; then + LOCAL=$(sudo git rev-parse HEAD) + sudo git fetch origin + REMOTE=$(sudo git rev-parse @{u} 2>/dev/null || echo "$LOCAL") if [[ "$LOCAL" != "$REMOTE" ]]; then log "Updates available." - git --no-pager log --oneline "$LOCAL".."$REMOTE" + sudo git --no-pager log --oneline "$LOCAL".."$REMOTE" echo "" if confirm "Update repo?"; then - git pull --ff-only + sudo git pull --ff-only log "Repo updated." else log "Repo update skipped."