[Unit]
Description=Connect to wifi
After=network.target
Requires=network.target

[Service]
Type=simple
# Add the environment variables to the service
Environment="WIFI_SSID={{ wifi_ssid }}" "WIFI_PASSWORD={{ wifi_password }}"
ExecStart=/usr/bin/nmcli d wifi connect $WIFI_SSID password $WIFI_PASSWORD
Restart=on-failure
TimeoutSec=60
RestartSec=30

[Install]
WantedBy=multi-user.target
