I’m using sway, and I noticed that the dbus-update-activation-environment
executable provided by the dbus package is not in the path; so when
.config/sway/config includes /etc/sway/config.d/nixos, which has this contents:
# Import the most important environment variables into the D-Bus and systemd
# user environments (e.g. required for screen sharing and Pinentry prompts):
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
it has no effect. Likewise, the dbus-sway-environment workaround in the example configuration shown in the NixOS Sway wiki page does not work, since the script that it creates tries to directly execute dbus-update-activation-environment, which is not in the path.
The dbus-update-activation-environment executable seems to be located under the dbus package in the nix store at a path similar to
./n742zqfsr1aa4c64h7801w66j3m0rc9f-dbus-1.14.10/bin/dbus-update-activation-environment
but there is no store entry for the dbus-update-activation-environment executable itself, and
no symlink for dbus-update-activation-environment under /run/current-system/sw/bin/.
Possibly because of this, the xdg-desktop-portal-wlr.service does not start as a user service, since it doesn’t find WAYLAND_DISPLAY in the appropriate environment. (Note, working from a shell inside a sway session, all of the environment variables DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP are set, but that apparently does not apply to the environment used to start xdg-desktop-portal-wlr.service).
Although I could probably find a hack workaround for the above, I’m quite new at NixOS and I’m not sure what the best way to fix it would be.
Suggestions are welcome!