mirror of
https://github.com/fscotto/infra.git
synced 2026-07-29 16:20:01 +00:00
Compare commits
11 Commits
3460c2a9cb
...
890a135f1d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
890a135f1d | ||
|
|
e2e0fc8701 | ||
|
|
593d5a2dfd | ||
|
|
6014354c8f | ||
|
|
d8ba674df7 | ||
|
|
7327bab7f2 | ||
|
|
e6467017d9 | ||
|
|
5d45955cec | ||
|
|
c34e9dccb9 | ||
|
|
27e6541357 | ||
|
|
f4b9b35c4e |
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_sessions_enabled:
|
||||
- i3
|
||||
- sway
|
||||
|
||||
desktop_default_session: i3
|
||||
desktop_default_session_env: xorg
|
||||
desktop_default_session: sway
|
||||
desktop_default_session_env: wayland
|
||||
desktop_prompt_for_session: true
|
||||
|
||||
desktop_source_tools:
|
||||
@@ -206,6 +206,14 @@ desktop_sway_dotfiles:
|
||||
src: .config/wlogout/
|
||||
dest: .config/wlogout/
|
||||
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:
|
||||
- be.alexandervanhee.gradia
|
||||
|
||||
@@ -18,6 +18,7 @@ void_packages_base:
|
||||
- elogind
|
||||
- fastfetch
|
||||
- fuse3
|
||||
- fuse-sshfs
|
||||
- gcc
|
||||
- gdb
|
||||
- gist
|
||||
@@ -159,6 +160,7 @@ desktop_sway_packages:
|
||||
- flameshot
|
||||
- foot
|
||||
- foot-terminfo
|
||||
- gtklock
|
||||
- grim
|
||||
- kanshi
|
||||
- rofi
|
||||
@@ -166,7 +168,6 @@ desktop_sway_packages:
|
||||
- swayfx
|
||||
- swaybg
|
||||
- swayidle
|
||||
- swaylock
|
||||
- SwayOSD
|
||||
- Waybar
|
||||
- wl-clipboard
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
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 + [] }}"
|
||||
|
||||
@@ -3,6 +3,7 @@ enabled_services:
|
||||
- docker
|
||||
|
||||
workstation_dev_wsl_packages:
|
||||
- lazygit
|
||||
- pinentry-curses
|
||||
- python3-pip
|
||||
workstation_dev_wsl_excluded_packages:
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
hostname: ikaros
|
||||
|
||||
desktop_sessions_enabled:
|
||||
- i3
|
||||
- sway
|
||||
|
||||
desktop_default_session: i3
|
||||
desktop_default_session_env: xorg
|
||||
desktop_default_session: sway
|
||||
desktop_default_session_env: wayland
|
||||
|
||||
host_packages:
|
||||
- openssh
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
hostname: nymph
|
||||
|
||||
desktop_sessions_enabled:
|
||||
- i3
|
||||
- sway
|
||||
|
||||
desktop_default_session: i3
|
||||
desktop_default_session_env: xorg
|
||||
desktop_default_session: sway
|
||||
desktop_default_session_env: wayland
|
||||
desktop_emptty_session_error_logging: rotate
|
||||
|
||||
host_packages:
|
||||
@@ -42,3 +41,6 @@ host_sway_dotfiles:
|
||||
- src: .config/kanshi/
|
||||
dest: .config/kanshi/
|
||||
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
|
||||
loop_control:
|
||||
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]
|
||||
conflictstyle = diff3
|
||||
tool = meld
|
||||
tool = vscode
|
||||
|
||||
[mergetool]
|
||||
prompt = false
|
||||
|
||||
[mergetool "vscode"]
|
||||
cmd = code --reuse-window --wait $MERGED
|
||||
|
||||
[diff]
|
||||
tool = meld
|
||||
tool = vscode
|
||||
|
||||
[difftool "vscode"]
|
||||
cmd = code --reuse-window --wait --diff $LOCAL $REMOTE
|
||||
|
||||
[color]
|
||||
ui = always
|
||||
|
||||
@@ -8,7 +8,7 @@ height = (0, 120)
|
||||
origin = top-right
|
||||
offset = (20, 40)
|
||||
|
||||
font = LiterationMono Nerd Font 10
|
||||
font = NotoSans NF 10
|
||||
line_height = 2
|
||||
|
||||
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
|
||||
terminal=yes
|
||||
|
||||
# Inhebit screensaver while playing video
|
||||
stop-screensaver=yes
|
||||
|
||||
@@ -2,7 +2,7 @@ configuration {
|
||||
modi: "drun,run,window";
|
||||
show-icons: true;
|
||||
icon-theme: "Yaru";
|
||||
font: "LiterationMono Nerd Font 11";
|
||||
font: "NotoSans NF 11";
|
||||
}
|
||||
|
||||
* {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set $mod Mod4
|
||||
|
||||
font pango:LiterationMono Nerd Font 10
|
||||
font pango:NotoSans NF 10
|
||||
|
||||
# vim-like directions
|
||||
set $left h
|
||||
@@ -35,7 +35,7 @@ input * {
|
||||
seat * xcursor_theme Yaru 24
|
||||
|
||||
# Outputs
|
||||
output * bg ~/.config/sway/wallpapers/wallpaper-161664.jpg center
|
||||
output * bg ~/.config/sway/wallpapers/darth-vader-sam.jpg center
|
||||
|
||||
# SwayFX effects
|
||||
corner_radius 8
|
||||
@@ -114,6 +114,8 @@ exec dex --autostart --environment sway
|
||||
exec gnome-keyring-daemon --start --components=secrets
|
||||
exec_always ~/.config/sway/scripts/setup-gtk-theme.sh
|
||||
exec /usr/libexec/xdg-desktop-portal
|
||||
exec /usr/libexec/xdg-desktop-portal-wlr
|
||||
exec /usr/libexec/xdg-desktop-portal-gtk
|
||||
|
||||
# Audio
|
||||
exec pipewire
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec swaylock \
|
||||
--image "$HOME/.config/sway/wallpapers/maxresdefault.jpg" \
|
||||
--scaling fill \
|
||||
--indicator-radius 100 \
|
||||
--ring-color 2f4058 \
|
||||
--inside-color 1f1f28 \
|
||||
--line-color 00000000 \
|
||||
--separator-color 3a3a46 \
|
||||
--key-hl-color 6daeea \
|
||||
--bs-hl-color c7162b \
|
||||
--ring-ver-color 4a90d9 \
|
||||
--inside-ver-color 1f1f28 \
|
||||
--ring-wrong-color c7162b \
|
||||
--inside-wrong-color 1f1f28 \
|
||||
--text-color d0d0d0
|
||||
WALLPAPER="$HOME/.config/sway/wallpapers/maxresdefault.jpg"
|
||||
STYLE_TMP=$(mktemp /tmp/gtklock-XXXXXX.css)
|
||||
|
||||
cat "$HOME/.config/gtklock/style.css" > "$STYLE_TMP"
|
||||
printf '\nwindow { background-image: url("file://%s"); background-size: cover; background-position: center; background-repeat: no-repeat; }\n' \
|
||||
"$WALLPAPER" >> "$STYLE_TMP"
|
||||
|
||||
gtklock --style "$STYLE_TMP"
|
||||
rm -f "$STYLE_TMP"
|
||||
|
||||
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;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
(load-theme 'nordic-night t))
|
||||
|
||||
;; 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
|
||||
'(font . "FantasqueSansM Nerd Font-14"))
|
||||
'(font . "UbuntuSansMono Nerd Font-14"))
|
||||
|
||||
;; Remove toolbar
|
||||
(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