Files
arch-configs/dot_config/systemd/user/chezmoi-shutdown-sync.service
T
JoseviandClaude Sonnet 5 ca8997663b Sistema de sync boot/shutdown con chezmoi (systemd --user)
Añade chezmoi-boot-sync.service (aplica la config respaldada al
arrancar, vía chezmoi update) y chezmoi-shutdown-sync.service (re-add +
commit + push al cerrar sesión/apagar, usando el truco de ExecStop en
un servicio oneshot con RemainAfterExit). Ambos a nivel de usuario, sin
depender de sudo.

run_once_after_enable-chezmoi-sync-linger.sh habilita 'loginctl
enable-linger' automáticamente en cualquier máquina nueva donde se
aplique este repo, para que la instancia systemd --user (y por tanto
ambos servicios) sobreviva al logout y arranque con el sistema.

El remoto origin pasó de SSH a HTTPS: el push automático desde un
servicio systemd no tiene acceso al agente SSH (Bitwarden) de la
sesión interactiva, así que usa el token cacheado por
credential.helper=store en su lugar.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-31 20:24:20 +02:00

15 lines
290 B
Desktop File

[Unit]
Description=Chezmoi: respalda config al cerrar sesión/apagar
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=%h/.local/bin/chezmoi-shutdown-sync.sh
TimeoutStopSec=30
[Install]
WantedBy=default.target