Systemd looks to be a bit less tolerant about $VAR than bash is. Replace $VAR with ${VAR} in places in the systemd configuration file to get the substitutions working.