Compare commits

...

3 Commits

Author SHA1 Message Date
Fabio Scotto di Santolo
890a135f1d scripts: add remove_i3.sh to purge i3 packages and dotfiles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 19:58:50 +02:00
Fabio Scotto di Santolo
e2e0fc8701 desktop: switch to sway as sole active session and group default
Remove i3 from desktop_sessions_enabled on ikaros, nymph, and the
desktop group_vars; set sway/wayland as default for all desktop hosts.
Copy 60-camera-priority.conf into host_sway_dotfiles on nymph so
WirePlumber camera priority is still deployed under the sway session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 19:49:32 +02:00
Fabio Scotto di Santolo
593d5a2dfd docs: add CLAUDE.md with project guidance for Claude Code
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 19:48:15 +02:00
5 changed files with 112 additions and 9 deletions

72
CLAUDE.md Normal file
View File

@@ -0,0 +1,72 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## What this repo is
Ansible-driven personal infrastructure as code for Void Linux desktops (`ikaros`, `nymph`), Linux/Windows workstations (`deadalus-*`), and an Ubuntu server (`prometheus`). See `AGENTS.md` for topology and `README.md` for full profile descriptions.
## Validation commands
```bash
# Minimum before any change
ansible-playbook ansible/site.yml --syntax-check
# Dry-run per host
ansible-playbook ansible/site.yml --limit ikaros --check --diff
ansible-playbook ansible/site.yml --limit nymph --check --diff
ansible-playbook ansible/site.yml --limit deadalus-ubuntu --check --diff
ansible-playbook ansible/site.yml --limit deadalus-fedora --check --diff
ansible-playbook ansible/site.yml --limit deadalus-wsl --check --diff
ansible-playbook ansible/site.yml --limit prometheus --check --diff
# Linting
ansible-lint ansible/site.yml
ansible-lint ansible/roles
yamllint ansible/
# Tag-scoped dry-run
ansible-playbook ansible/site.yml --limit ikaros --tags <tag> --check --diff
# Shell scripts
sh -n scripts/bootstrap_mail.sh && shellcheck scripts/bootstrap_mail.sh
```
## Architecture
Configuration is composed in layers: `all → OS → profile → host`. Most hosts use `ansible_connection: local`; `deadalus-win` is the PSRP/Windows exception.
`ansible/site.yml` is the sole orchestration entry point — keep it thin. Implementation belongs in roles under `ansible/roles/`.
Variable layering:
- `ansible/inventory/group_vars/` — OS and profile defaults
- `ansible/inventory/host_vars/` — host-specific overrides (never put host overrides in group_vars)
Dotfiles under `dotfiles/` mirror the same layer split: `common/`, `desktop/`, `server/`, `workstation/`, then per-host directories (`ikaros/`, `nymph/`).
## Key conventions
- FQCN for all Ansible modules.
- Prefer declarative modules over `command`/`shell`; when shell is unavoidable, make idempotency explicit.
- YAML: start with `---`, 2-space indent, file modes quoted as `"0644"`, booleans as booleans.
- `no_log: true` on any task that handles secrets.
- Do not restart `emptty` in playbook tasks on active desktop hosts — do it manually via SSH/TTY.
## Void desktop package buckets (keep disjoint)
- `void_packages_base` — system runtime (init, kernel, audio core, networking, firewall, hw daemons)
- `desktop_common_packages` — WM-agnostic GUI infra (GTK theme, polkit, keyring, portals, flatpak, printing)
- `desktop_i3_packages` / `desktop_sway_packages` — session-specific binaries; cross-WM packages used by both (`dunst`, `rofi`, `alacritty`) are intentionally duplicated
- `profile_packages` — cross-distro; do not move desktop-only Void entries into it
Dotfile var split follows the same logic: `desktop_common_dotfiles` (WM-agnostic), `desktop_void_dotfiles` (Void runtime — turnstile services, bash fragments).
## Secrets
- `secrets/vault.yml` and `secrets/vault.local.yml` are loaded conditionally if present.
- `secrets/.vault_pass.gpg` is used automatically if present; falls back to `secrets/.vault_pass`.
- Never print vault values; always use `no_log: true` where secrets flow through tasks.
## AI agent dotfiles
Shared agent instructions live in `dotfiles/common/.config/ai/`. Agent-specific entrypoints reference that path rather than duplicating content. Shared npm packages are in `ai_agents_npm_packages` in `ansible/inventory/group_vars/all.yml`.

View File

@@ -2,10 +2,10 @@
desktop_protonmail_bridge_cert_path: ~/.var/app/ch.protonmail.protonmail-bridge/config/protonmail/bridge-v3/cert.pem desktop_protonmail_bridge_cert_path: ~/.var/app/ch.protonmail.protonmail-bridge/config/protonmail/bridge-v3/cert.pem
desktop_sessions_enabled: desktop_sessions_enabled:
- i3 - sway
desktop_default_session: i3 desktop_default_session: sway
desktop_default_session_env: xorg desktop_default_session_env: wayland
desktop_prompt_for_session: true desktop_prompt_for_session: true
desktop_source_tools: desktop_source_tools:

View File

@@ -2,11 +2,10 @@
hostname: ikaros hostname: ikaros
desktop_sessions_enabled: desktop_sessions_enabled:
- i3
- sway - sway
desktop_default_session: i3 desktop_default_session: sway
desktop_default_session_env: xorg desktop_default_session_env: wayland
host_packages: host_packages:
- openssh - openssh

View File

@@ -2,11 +2,10 @@
hostname: nymph hostname: nymph
desktop_sessions_enabled: desktop_sessions_enabled:
- i3
- sway - sway
desktop_default_session: i3 desktop_default_session: sway
desktop_default_session_env: xorg desktop_default_session_env: wayland
desktop_emptty_session_error_logging: rotate desktop_emptty_session_error_logging: rotate
host_packages: host_packages:
@@ -42,3 +41,6 @@ host_sway_dotfiles:
- src: .config/kanshi/ - src: .config/kanshi/
dest: .config/kanshi/ dest: .config/kanshi/
mode: preserve mode: preserve
- src: .config/wireplumber/wireplumber.conf.d/60-camera-priority.conf
dest: .config/wireplumber/wireplumber.conf.d/60-camera-priority.conf
mode: "0644"

30
scripts/remove_i3.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
# Rimuove i3 e relativi dotfiles dall'host corrente.
# Eseguire dopo aver verificato che sway funzioni correttamente.
set -e
HOSTNAME=$(hostname)
# Pacchetti i3-only (dunst e rofi sono condivisi con sway, non rimossi)
sudo xbps-remove -R arandr autorandr feh i3 i3blocks i3blocks-blocklets \
i3lock-color i3status picom polybar scrot setxkbmap volumeicon xclip \
xfce4-clipman-plugin xfce4-screenshooter xkbutils xorg-fonts xorg-minimal \
xss-lock xdotool
# Dotfiles i3-only
rm -rf ~/.config/i3 ~/.config/i3blocks
rm -f ~/.config/picom/picom.conf
rmdir --ignore-fail-on-non-empty ~/.config/picom
rm -f ~/.config/polybar/config.ini ~/.config/polybar/launch.sh
rmdir --ignore-fail-on-non-empty ~/.config/polybar
rm -f ~/.xinitrc
# Session file emptty
sudo rm -f /etc/emptty/xsessions/i3.desktop
# Dotfiles host-specifici
case "$HOSTNAME" in
ikaros|nymph)
rm -rf ~/.config/autorandr
;;
esac