[Unit]
Description=Nucleic Linux guest agent (vsock control plane)
Documentation=https://github.com/ (docs/LINUX_VM.md)
# The agent binds AF_VSOCK, which needs the vsock transport up; network is not required (vsock is not
# IP), but ordering after basic.target keeps it out of very early boot.
After=basic.target
Wants=basic.target

[Service]
Type=simple
ExecStart=/usr/local/bin/nucleic-linux-agent
# Like the macOS LaunchAgent's KeepAlive: a crashed agent is restarted so a host reconnect always finds
# a listener without needing the whole guest to reboot.
Restart=always
RestartSec=1
# The agent execs commands the host sends; it runs as root in a disposable, NAT-isolated guest.
User=root
# Standard streams go to the journal (systemd stamps them); the agent logs to stderr.
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
