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>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
274f4f0e58
commit
ca8997663b
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Chezmoi: aplica config respaldada al iniciar sesión
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=%h/.local/bin/chezmoi-boot-sync.sh
|
||||
TimeoutStartSec=60
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user