This seems like a good idea in general and will at least make it easier
to get screen sharing to work (but still requires a proper NixOS
configuration including xdg-desktop-portal-wlr).
Note: It isn't necessary to set XDG_SESSION_TYPE=wayland as wlroots
already takes care of it (currently at least for the logind and libseat
session backends, the next wlroots release will require libseat):
4839664a92/backend/session/session.c (L80)
The default config.in template contains
"include @sysconfdir@/sway/config.d/*" but we've dropped it to better
support non-NixOS (which seems like a mistake in retrospect).
This restores that behaviour and extends the default configuration via
nixos.conf to fix#119445.
Note: The security configurations (security.d) where dropped entirely
(but maybe they'll return).
This is useful for use-cases like this (logging to journald):
```
programs.sway.extraSessionCommands = ''
if [ -z "$_SWAY_DID_SYSTEMD_CAT" ]; then
export _SWAY_DID_SYSTEMD_CAT=1
exec ${config.systemd.package}/bin/systemd-cat -t sway "$0" "$@"
fi
# ... (potentially also another exec)
'';
```
Without this change the rest of the extraSessionCommands won't be
executed after the exec since the whole extraSessionCommands block would
be skipped during the re-execution (_SWAY_WRAPPER_ALREADY_EXECUTED is
already set).