Setting systemd.service specific option in a snap service/daemon


One of our project uses a systemd service. For the Debian package version, we define it in a file, whereas for the snap version we define it in the snapcraft.yaml recipe.

We would like to introduce an additional configuration (OOMPolicy=continue based on systemd documentation). It’s a simple one-liner for the service file, but I don’t know how to do this for the service in the snap.

I’ve had a look at the documentation, but I couldn’t find an answer.

Is it possible to achieve this using the snapcraft.yaml recipe? If not, is there a workaround we could use?

Thanks in advance!