Talk:Sway

From NixOS Wiki
Revision as of 18:44, 31 December 2023 by imported>Dkrejsa

xdg.portal.gtkUsePortal is deprecated

The method introduced here results in some warnings and errors.

trace: warning: The option `xdg.portal.gtkUsePortal' defined in `/etc/nixos/configuration.nix' has been deprecated. Setting the variable globally with `environment.sessionVariables' NixOS option can have unforseen side-effects.

error: collision between `/nix/store/k12lcwkw2mlrv962ygqq9gwk4qml33sg-xdg-desktop-portal-gtk-1.14.0/share/applications/xdg-desktop-portal-gtk.desktop' and `/nix/store/kxzpf9mxqp5n665cyd416i31qjk8hn9n-xdg-desktop-portal-gtk-1.14.0/share/applications/xdg-desktop-portal-gtk.desktop'

error: builder for '/nix/store/8c2zlvjb0rq6gkkgsbrhq8wkwbyvlnfm-xdg-portals.drv' failed with exit code 255

error: 1 dependencies of derivation '/nix/store/0ni4810ibw9g6m80rrv0d72nc9z17wwn-etc-environment.drv' failed to build

error: 1 dependencies of derivation '/nix/store/prvzykrk7brf2pm1b0928ldgymp6ya6b-set-environment.drv' failed to build

error: 1 dependencies of derivation '/nix/store/9xxfd2wgvg7r46xy3rdp4mn5azp732n9-system-path.drv' failed to build

calls to dbus-update-activation-environment

Note that the default sway configuration template /etc/sway/config includes /etc/sway/config.d/*, and specifically includes /etc/sway/config.d/nixos.conf , which has the following 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

Likewise, the example configuration in the wiki creates a script /bin/dbus-sway-environment that attempts to call dbus-update-activation-environment. (Note, the dbus-sway-environment script might not be necessary given the inclusion of /etc/sway/config.d/nixos.conf.) However, neither of these attempts to execute

   dbus-update-activation-environment

works unless dbus-update-activation-environment is in the path (e.g., unless there is a symlink /run/current-system/sw/bin/dbus-update-activation-environment pointing at the executable somewhere under /nix/store/). To get dbus-update-activation-environment and the other binaries from the dbus package into the general path, one should add pkgs.dbus to the environment.systemPackages list in configuration.nix. (If using home manager, this might be accomplished by other means.)