mirror of
https://github.com/fscotto/infra.git
synced 2026-07-29 16:20:01 +00:00
Compare commits
11 Commits
890a135f1d
...
3460c2a9cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3460c2a9cb | ||
|
|
626a29cfcf | ||
|
|
e18bc8920d | ||
|
|
6b242a71b9 | ||
|
|
6f6ea84fa3 | ||
|
|
818d972493 | ||
|
|
a2c5d77483 | ||
|
|
a6a83fb74b | ||
|
|
6cf87f3c38 | ||
|
|
a6049961a8 | ||
|
|
9587ba9e97 |
72
CLAUDE.md
Normal file
72
CLAUDE.md
Normal 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`.
|
||||||
@@ -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:
|
||||||
@@ -206,6 +206,14 @@ desktop_sway_dotfiles:
|
|||||||
src: .config/wlogout/
|
src: .config/wlogout/
|
||||||
dest: .config/wlogout/
|
dest: .config/wlogout/
|
||||||
mode: preserve
|
mode: preserve
|
||||||
|
- name: foot config
|
||||||
|
src: .config/foot/
|
||||||
|
dest: .config/foot/
|
||||||
|
mode: preserve
|
||||||
|
- name: gtklock config
|
||||||
|
src: .config/gtklock/
|
||||||
|
dest: .config/gtklock/
|
||||||
|
mode: preserve
|
||||||
|
|
||||||
desktop_flatpak_packages:
|
desktop_flatpak_packages:
|
||||||
- be.alexandervanhee.gradia
|
- be.alexandervanhee.gradia
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ void_packages_base:
|
|||||||
- elogind
|
- elogind
|
||||||
- fastfetch
|
- fastfetch
|
||||||
- fuse3
|
- fuse3
|
||||||
|
- fuse-sshfs
|
||||||
- gcc
|
- gcc
|
||||||
- gdb
|
- gdb
|
||||||
- gist
|
- gist
|
||||||
@@ -159,6 +160,7 @@ desktop_sway_packages:
|
|||||||
- flameshot
|
- flameshot
|
||||||
- foot
|
- foot
|
||||||
- foot-terminfo
|
- foot-terminfo
|
||||||
|
- gtklock
|
||||||
- grim
|
- grim
|
||||||
- kanshi
|
- kanshi
|
||||||
- rofi
|
- rofi
|
||||||
@@ -166,7 +168,6 @@ desktop_sway_packages:
|
|||||||
- swayfx
|
- swayfx
|
||||||
- swaybg
|
- swaybg
|
||||||
- swayidle
|
- swayidle
|
||||||
- swaylock
|
|
||||||
- SwayOSD
|
- SwayOSD
|
||||||
- Waybar
|
- Waybar
|
||||||
- wl-clipboard
|
- wl-clipboard
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
workstation_manage_opencode: true
|
workstation_manage_opencode: true
|
||||||
|
workstation_manage_ibm_bob: true
|
||||||
|
workstation_ibm_bob_install_url: "https://bob.ibm.com/download/bobshell.sh"
|
||||||
workstation_npm_packages: "{{ ai_agents_npm_packages + [] }}"
|
workstation_npm_packages: "{{ ai_agents_npm_packages + [] }}"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ enabled_services:
|
|||||||
- docker
|
- docker
|
||||||
|
|
||||||
workstation_dev_wsl_packages:
|
workstation_dev_wsl_packages:
|
||||||
|
- lazygit
|
||||||
- pinentry-curses
|
- pinentry-curses
|
||||||
- python3-pip
|
- python3-pip
|
||||||
workstation_dev_wsl_excluded_packages:
|
workstation_dev_wsl_excluded_packages:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -48,3 +48,15 @@
|
|||||||
- workstation_npm_packages | length > 0
|
- workstation_npm_packages | length > 0
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
|
|
||||||
|
- name: Install IBM Bob coding agent
|
||||||
|
tags: [packages, ai_agents]
|
||||||
|
ansible.builtin.shell: >
|
||||||
|
curl -fsSL {{ workstation_ibm_bob_install_url }} | bash
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
creates: /usr/local/bin/bob
|
||||||
|
become: true
|
||||||
|
when:
|
||||||
|
- workstation_manage_ibm_bob | default(false)
|
||||||
|
- workstation_ibm_bob_install_url | length > 0
|
||||||
|
|||||||
@@ -24,13 +24,19 @@
|
|||||||
|
|
||||||
[merge]
|
[merge]
|
||||||
conflictstyle = diff3
|
conflictstyle = diff3
|
||||||
tool = meld
|
tool = vscode
|
||||||
|
|
||||||
[mergetool]
|
[mergetool]
|
||||||
prompt = false
|
prompt = false
|
||||||
|
|
||||||
|
[mergetool "vscode"]
|
||||||
|
cmd = code --reuse-window --wait $MERGED
|
||||||
|
|
||||||
[diff]
|
[diff]
|
||||||
tool = meld
|
tool = vscode
|
||||||
|
|
||||||
|
[difftool "vscode"]
|
||||||
|
cmd = code --reuse-window --wait --diff $LOCAL $REMOTE
|
||||||
|
|
||||||
[color]
|
[color]
|
||||||
ui = always
|
ui = always
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ height = (0, 120)
|
|||||||
origin = top-right
|
origin = top-right
|
||||||
offset = (20, 40)
|
offset = (20, 40)
|
||||||
|
|
||||||
font = LiterationMono Nerd Font 10
|
font = NotoSans NF 10
|
||||||
line_height = 2
|
line_height = 2
|
||||||
|
|
||||||
padding = 12
|
padding = 12
|
||||||
|
|||||||
5
dotfiles/desktop/.config/foot/foot.ini
Normal file
5
dotfiles/desktop/.config/foot/foot.ini
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[main]
|
||||||
|
font = Liberation Mono:size=14
|
||||||
|
|
||||||
|
[colors-dark]
|
||||||
|
background = 000000
|
||||||
1
dotfiles/desktop/.config/gtklock/config.ini
Normal file
1
dotfiles/desktop/.config/gtklock/config.ini
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[main]
|
||||||
49
dotfiles/desktop/.config/gtklock/style.css
Normal file
49
dotfiles/desktop/.config/gtklock/style.css
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
* {
|
||||||
|
font-family: "NotoSans NF", sans-serif;
|
||||||
|
color: #FFE81F;
|
||||||
|
}
|
||||||
|
|
||||||
|
window {
|
||||||
|
background-color: #00000A;
|
||||||
|
}
|
||||||
|
|
||||||
|
box {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
background-color: rgba(0, 0, 10, 0.6);
|
||||||
|
color: #FFE81F;
|
||||||
|
border: 1px solid #FFE81F;
|
||||||
|
border-radius: 0;
|
||||||
|
padding: 8px 16px;
|
||||||
|
caret-color: #FFE81F;
|
||||||
|
min-width: 320px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry > text {
|
||||||
|
color: #FFE81F;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry:focus {
|
||||||
|
border-color: #FFE81F;
|
||||||
|
box-shadow: 0 0 8px rgba(255, 232, 31, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
entry.error {
|
||||||
|
border-color: #c7162b;
|
||||||
|
box-shadow: 0 0 8px rgba(199, 22, 43, 0.6);
|
||||||
|
color: #c7162b;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
color: #FFE81F;
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
label.error {
|
||||||
|
color: #c7162b;
|
||||||
|
}
|
||||||
@@ -14,3 +14,6 @@ sub-font-size=48
|
|||||||
|
|
||||||
# Output
|
# Output
|
||||||
terminal=yes
|
terminal=yes
|
||||||
|
|
||||||
|
# Inhebit screensaver while playing video
|
||||||
|
stop-screensaver=yes
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ configuration {
|
|||||||
modi: "drun,run,window";
|
modi: "drun,run,window";
|
||||||
show-icons: true;
|
show-icons: true;
|
||||||
icon-theme: "Yaru";
|
icon-theme: "Yaru";
|
||||||
font: "LiterationMono Nerd Font 11";
|
font: "NotoSans NF 11";
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set $mod Mod4
|
set $mod Mod4
|
||||||
|
|
||||||
font pango:LiterationMono Nerd Font 10
|
font pango:NotoSans NF 10
|
||||||
|
|
||||||
# vim-like directions
|
# vim-like directions
|
||||||
set $left h
|
set $left h
|
||||||
@@ -35,7 +35,7 @@ input * {
|
|||||||
seat * xcursor_theme Yaru 24
|
seat * xcursor_theme Yaru 24
|
||||||
|
|
||||||
# Outputs
|
# Outputs
|
||||||
output * bg ~/.config/sway/wallpapers/wallpaper-161664.jpg center
|
output * bg ~/.config/sway/wallpapers/darth-vader-sam.jpg center
|
||||||
|
|
||||||
# SwayFX effects
|
# SwayFX effects
|
||||||
corner_radius 8
|
corner_radius 8
|
||||||
@@ -114,6 +114,8 @@ exec dex --autostart --environment sway
|
|||||||
exec gnome-keyring-daemon --start --components=secrets
|
exec gnome-keyring-daemon --start --components=secrets
|
||||||
exec_always ~/.config/sway/scripts/setup-gtk-theme.sh
|
exec_always ~/.config/sway/scripts/setup-gtk-theme.sh
|
||||||
exec /usr/libexec/xdg-desktop-portal
|
exec /usr/libexec/xdg-desktop-portal
|
||||||
|
exec /usr/libexec/xdg-desktop-portal-wlr
|
||||||
|
exec /usr/libexec/xdg-desktop-portal-gtk
|
||||||
|
|
||||||
# Audio
|
# Audio
|
||||||
exec pipewire
|
exec pipewire
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
exec swaylock \
|
WALLPAPER="$HOME/.config/sway/wallpapers/maxresdefault.jpg"
|
||||||
--image "$HOME/.config/sway/wallpapers/maxresdefault.jpg" \
|
STYLE_TMP=$(mktemp /tmp/gtklock-XXXXXX.css)
|
||||||
--scaling fill \
|
|
||||||
--indicator-radius 100 \
|
cat "$HOME/.config/gtklock/style.css" > "$STYLE_TMP"
|
||||||
--ring-color 2f4058 \
|
printf '\nwindow { background-image: url("file://%s"); background-size: cover; background-position: center; background-repeat: no-repeat; }\n' \
|
||||||
--inside-color 1f1f28 \
|
"$WALLPAPER" >> "$STYLE_TMP"
|
||||||
--line-color 00000000 \
|
|
||||||
--separator-color 3a3a46 \
|
gtklock --style "$STYLE_TMP"
|
||||||
--key-hl-color 6daeea \
|
rm -f "$STYLE_TMP"
|
||||||
--bs-hl-color c7162b \
|
|
||||||
--ring-ver-color 4a90d9 \
|
|
||||||
--inside-ver-color 1f1f28 \
|
|
||||||
--ring-wrong-color c7162b \
|
|
||||||
--inside-wrong-color 1f1f28 \
|
|
||||||
--text-color d0d0d0
|
|
||||||
|
|||||||
BIN
dotfiles/desktop/.config/sway/wallpapers/darth-vader-sam.jpg
Executable file
BIN
dotfiles/desktop/.config/sway/wallpapers/darth-vader-sam.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
@@ -1,5 +1,5 @@
|
|||||||
* {
|
* {
|
||||||
font-family: "LiterationMono Nerd Font", "Symbols Nerd Font Mono", monospace;
|
font-family: "NotoSans NF";
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
(load-theme 'nordic-night t))
|
(load-theme 'nordic-night t))
|
||||||
|
|
||||||
;; Setting default font
|
;; Setting default font
|
||||||
(set-frame-font "LiterationMono Nerd Font 14" nil t)
|
(set-frame-font "UbuntuSansMono Nerd Font 14" nil t)
|
||||||
|
|
||||||
(add-to-list 'default-frame-alist
|
(add-to-list 'default-frame-alist
|
||||||
'(font . "FantasqueSansM Nerd Font-14"))
|
'(font . "UbuntuSansMono Nerd Font-14"))
|
||||||
|
|
||||||
;; Remove toolbar
|
;; Remove toolbar
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
|
|||||||
30
scripts/remove_i3.sh
Normal file
30
scripts/remove_i3.sh
Normal 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
|
||||||
Reference in New Issue
Block a user