Sway can be compiled with or without systemd(-logind) and dbus. This
commit exposes that support via the global systemdSupport and
dbusSupport arguments, which are understood by many other nixpkgs
expressions and can be set globally in ~/.config/nixpkgs/config.nix.
This commit also adds a third argument, trayEnabled, which allows to
disable sway's tray. The tray requires dbusSupport and
systemdSupport.
Reviewers of this commit asked for potential use cases. There are
many of them; a very non-exhaustive list includes:
* Use of nixpkgs on operating systems which systemd does not support,
such as MacOS/Darwin, FreeBSD, OpenBSD, or Alpine Linux.
* Use of nixpkgs on *-musl platforms, which systemd does not
officially support (out-of-tree patches to support musl exist for a
few systemd versions).
* Use of sway in situations where dbus is inappropriate, such as
sway's "kiosk mode".
* High-security environments, where the additional attack surface
exposed by dbus outweighs any features it may offer.
This is a very non-exhaustive list.