systemd has an EnvironmentFile directive, which sets environment variables from a file's contents based on a number of rules, which are not quite equivalent to how a shell would parse that file.
How can I parse a systemd EnvironmentFile in exactly the same way that systemd itself would?