diff --git a/Makefile b/Makefile index 79f4b88..55d0fdc 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ .PHONY: basic term utils hypr kreation buntes-monster # basic wird immer zuerst eingerichtet: es legt die Basis-Systemumgebung an -# (multilib, yay, Display-Manager, Audio-Stack), von der alle anderen +# (multilib, yay, Display-Manager, Audio-Stack, Docker), von der alle anderen # Zweige abhaengen. Die uebrigen Ziele haengen nur von basic ab und sind # untereinander unabhaengig. basic: @@ -59,14 +59,15 @@ test-lint-docker: docker run --rm dotfiles-lint # Docker smoke test: builds the Arch container and runs the dry probes. -# By default (REAL_SMOKE=1) it also installs the real pacman packages inside -# the container and verifies them, so a plain `make test` actually exercises -# the install path. Set REAL_SMOKE=0 (or RUN_SMOKE=0) for the fast dry-probe -# run. RUN_FULL=1 additionally attempts AUR/npm + hypr/kreation. SKIP_NET=1 -# skips anything that contacts the network. -# Example: make test-smoke # real term package install + verify +# By default (REAL_SMOKE=1) it also installs the real term pacman + npm +# packages inside the container (AUR stays opt-in) and verifies them, so a +# plain `make test` actually exercises the install path. Set REAL_SMOKE=0 +# (or RUN_SMOKE=0) for the fast dry-probe run. RUN_FULL=1 additionally +# attempts AUR + hypr/kreation/buntes-monster. SKIP_NET=1 skips anything +# that contacts the network. +# Example: make test-smoke # real term pacman+npm install + verify # make test-smoke REAL_SMOKE=0 # dry probes only -# make test-smoke RUN_FULL=1 # full AUR/npm + hypr/kreation +# make test-smoke RUN_FULL=1 # full AUR + hypr/kreation REAL_SMOKE ?= 1 test-smoke: docker build --target test -t dotfiles-test -f test/Dockerfile . diff --git a/README.md b/README.md index 515478a..4672ab3 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ Run `make ` from the repository root. Each target first runs the relevan | Target | What it does | |--------|--------------| -| `make term` | Runs `term/setup.sh` (installs terminal packages, sets fish as default shell, clones tmuxifier), then `stow term` | -| `make basic` | Runs `install_basic_pcks.sh`, stows `nvim`, runs `nextcloud.sh` | +| `make term` | Runs `term/setup.sh` (installs terminal packages, sets fish as default shell, clones tmuxifier), then `stow term`. Pulls in `basic`. | +| `make basic` | Runs `basic/setup.sh`: enables multilib, updates the system, installs `yay` if missing, installs the `basic/packages.txt` packages, and sets up Docker (enables/starts the service, adds your user to the `docker` group, verifies the service) | | `make hypr` | `make basic`, installs Hyprland packages, stows `hypr`, runs the Hyprland setup scripts (`ensure-env.sh`, `portal-host-override.sh`, `fix_dolphin_file_associations.sh`) | | `make kreation` | `make basic`, installs VST runtime, stows `kreation` | | `make buntes-monster` | Everything (`basic` + `hypr` + `kreation`), then wires up symlinks | @@ -64,11 +64,12 @@ Add/remove packages on separate lines. Lines starting with `#` are ignored, and @npm # install via npm -g ``` -The default section is `@pacman`. Any AUR dependency (`yay`) is bootstrapped automatically by `term/setup.sh`. +The default section is `@pacman`. The AUR helper `yay` is bootstrapped automatically by `basic/setup.sh`. ## What the install scripts do -- **`term/setup.sh`** – enables multilib, updates the system, installs `yay` if missing, reads `term/packages.txt` and installs all packages with `--needed` (skips already-installed ones), sets `fish` as the default shell (`chsh -s /usr/bin/fish`), clones `tmuxifier`, adds the `git` yazi plugin, and runs `sudo updatedb`. It is idempotent and safe to re-run. +- **`basic/setup.sh`** – enables multilib, updates the system (`pacman -Syu`), ensures `yay` is installed, reads `basic/packages.txt` and installs all packages with `--needed` (skips already-installed ones), and sets up Docker (`sudo systemctl enable --now docker`, adds the current user to the `docker` group, checks the service). Idempotent and safe to re-run. +- **`term/setup.sh`** – reads `term/packages.txt` and installs all packages (pacman/AUR via `yay --needed`, npm via `sudo npm install -g`), sets `fish` as the default shell (`chsh`), clones `tmuxifier`, adds the `git` yazi plugin (skips if already present), and runs `sudo updatedb`. Idempotent and safe to re-run. ## Stow: resolving conflicts with existing paths @@ -140,15 +141,15 @@ There are **two tiers**: | `make test-stow` | `stow --simulate` for every stow-able package; fails if a package the Makefile stows doesn't exist (e.g. `stow nvim` — nvim lives under `term/`). | No | | `make test-shellcheck` | Runs shellcheck over all tracked scripts (shellcheck must be installed). | No | | `make test-lint-docker` | Builds the `/dev` stage (`archlinux:latest` + shellcheck) and runs `test/lint.sh` inside it. | Yes | -| `make test-smoke` | Builds the `/test` stage, runs the container's dry probes (`make -n` over every target, `stow --simulate` over every Makefile-stowed package, `test/lint.sh`), **and by default installs the real pacman packages** (`REAL_SMOKE=1`) then verifies them. | Yes | +| `make test-smoke` | Builds the `/test` stage, runs the container's dry probes (`make -n` over every target, `stow --simulate` over every Makefile-stowed package, `test/lint.sh`), **and by default installs the real term pacman + npm packages** (`REAL_SMOKE=1`) then verifies them. Every `@pacman` entry is also pre-resolved against the repo DB, and the install is re-run to prove idempotency. | Yes | | `make test` | `test-lint` + `test-smoke` (the real install runs). | Partially | ### Docker smoke details ```bash -make test-smoke # real pacman install of the term packages + verify +make test-smoke # real pacman + npm install of the term packages + verify make test-smoke REAL_SMOKE=0 # dry probes only (fast, no installs) -make test-smoke RUN_SMOKE=1 RUN_FULL=1 # + AUR/npm + hypr/kreation/buntes-monster +make test-smoke RUN_SMOKE=1 RUN_FULL=1 # + AUR + hypr/kreation/buntes-monster make test-smoke SKIP_NET=1 # skip anything that contacts the network ``` @@ -162,7 +163,7 @@ The container: - stubs host-dependent commands as no-ops so nothing talks to a real systemd/dbus inside the container (`systemctl`, `updatedb`, `kbuildsycoca6`, `dbus-update-activation-environment`, `chsh`), and routes `yay` through - `pacman` for the pacman-only smoke. + `pacman` for the AUR-free smoke. In the `REAL_SMOKE=1` (default) install path, the harness additionally **verifies the installed packages** (`test/verify_packages.sh`): diff --git a/basic/setup.sh b/basic/setup.sh index dcfb78c..1750d65 100644 --- a/basic/setup.sh +++ b/basic/setup.sh @@ -89,6 +89,37 @@ install_npm() { fi } +# --------------------------------------------------------------------------- +# Docker: Dienst aktivieren/starten, Benutzer in die docker-Gruppe aufnehmen +# und den Dienst verifizieren. (docker selbst wird ueber basic/packages.txt +# als Pacman-Paket installiert.) +# --------------------------------------------------------------------------- +setup_docker() { + if ! command -v docker >/dev/null 2>&1; then + echo "Warnung: docker nicht installiert; ueberspringe Docker-Setup." + return + fi + + echo "==> Aktiviere und starte Docker-Dienst ..." + sudo systemctl enable --now docker + + # Bei Aufruf via `sudo