This is not really a wayland or sway problem, but really a systemd problem. It's really annoying because the documentation around this is very scattered and contradictory.
The advice used to be that you should use pam user environment (~/.environment and you need to edit pam configuration on some distributions to allow user environments). However, IIRC there are some possible security implications around this so this has been deprecated. I think you are now supposed to use systemd user variables (or so). I'm not on my computer right now so can't look it up, but hopefully that gives you enough Google keywords to set things up.
It seems like the main developers behind systemd and several of the other fundamental layers of the system stack only use gnome/KDE and assume everyone else is. So some things become quite frustrating to set up for regular users.
Yeah, I can create files in ~/.config/environment.d/ to set some environment variables. My problems are that (a) that syntax only allows very simple variable assignments, not complex things like "run ssh-agent and add the environment variables it prints to stdout" and (b) those environment variables aren't available to the Wayland compositor or applications it launches.
The advice used to be that you should use pam user environment (~/.environment and you need to edit pam configuration on some distributions to allow user environments). However, IIRC there are some possible security implications around this so this has been deprecated. I think you are now supposed to use systemd user variables (or so). I'm not on my computer right now so can't look it up, but hopefully that gives you enough Google keywords to set things up.
It seems like the main developers behind systemd and several of the other fundamental layers of the system stack only use gnome/KDE and assume everyone else is. So some things become quite frustrating to set up for regular users.