Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: swaync causes xdg-desktop-portal to run into a timeout #5877

Open
2 tasks done
Ma27 opened this issue Sep 21, 2024 · 0 comments
Open
2 tasks done

bug: swaync causes xdg-desktop-portal to run into a timeout #5877

Ma27 opened this issue Sep 21, 2024 · 0 comments
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@Ma27
Copy link
Member

Ma27 commented Sep 21, 2024

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

When xdg-desktop-portal is enabled on NixOS via

{
  xdg.portal = {
    enable = true;
    extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
    config.common.default = "*";
  };
}

and services.swaync.enable = true; is set to true in home-manager, the desktop portal runs into a timeout. I use the sway module from home-manager with the sway-session.target systemd-target.

I should add that I'm using impermanence and on the very first start of my desktop session I activate my home-manager config like this:

{
  programs = lib.genAttrs [ "zsh" "bash" ] (shell: {
    interactiveShellInit = ''
      if ! [[ -v TRIED_HOME_MANAGER_ACTIVATE || -e $HOME/.config/environment.d/10-home-manager.conf ]]; then
        hm="$HOME/.local/state/nix/profiles/home-manager"
        [[ -x $hm/bin/home-manager-generation ]] && $hm/bin/home-manager-generation
        export TRIED_HOME_MANAGER_ACTIVATE=1
        exec ${shell} -l
      fi
    '';
  });
}

Relevant logs:

Sep 21 16:04:29 snens systemd[6672]: Reloading requested from client PID 7116 ('sd-switch')...
Sep 21 16:04:29 snens systemd[6672]: Reloading...
Sep 21 16:04:29 snens systemd[6672]: Reloading finished in 125 ms.
Sep 21 16:04:29 snens systemd[6672]: Starting Run user-specific NixOS activation...
Sep 21 16:04:29 snens systemd[6672]: Starting MPRIS media player daemon...
Sep 21 16:04:29 snens systemd[6672]: Starting sops-nix activation...
Sep 21 16:04:29 snens systemd[6672]: Started MPRIS media player daemon.
Sep 21 16:04:29 snens systemd[6672]: Finished Run user-specific NixOS activation.
Sep 21 16:04:29 snens systemd[6672]: Finished sops-nix activation.
Sep 21 16:04:29 snens systemd[6672]: Starting sops-nix activation...
Sep 21 16:04:29 snens systemd[6672]: Finished sops-nix activation.
Sep 21 16:04:29 snens systemd[6672]: Starting sops-nix activation...
Sep 21 16:04:29 snens systemd[6672]: Finished sops-nix activation.
Sep 21 16:04:31 snens systemd[6672]: Started Clipboard manager.
Sep 21 16:04:31 snens systemd[6672]: Started GNOME Keyring.
Sep 21 16:04:31 snens systemd[6672]: Reached target Session services which should run early before the graphical session is brought up.
Sep 21 16:04:31 snens systemd[6672]: Reached target Home Manager System Tray.
Sep 21 16:04:31 snens systemd[6672]: Started Gammastep colour temperature adjuster.
Sep 21 16:04:31 snens systemd[6672]: Started Nextcloud Client.
Sep 21 16:04:31 snens systemd[6672]: Started UPower-powered power alerter.
Sep 21 16:04:31 snens systemd[6672]: Started Safeeyes.
Sep 21 16:04:31 snens systemd[6672]: Started Idle manager for Wayland.
Sep 21 16:04:31 snens systemd[6672]: Starting Swaync notification daemon...
Sep 21 16:04:31 snens systemd[6672]: Started udiskie mount daemon.
Sep 21 16:04:31 snens systemd[6672]: Started Clipboard URL cleanup service.
Sep 21 16:04:31 snens systemd[6672]: Started Highly customizable Wayland bar for Sway and Wlroots based compositors..
Sep 21 16:04:31 snens systemd[6672]: Starting Portal service...
Sep 21 16:04:31 snens systemd[6672]: Starting flatpak document portal service...
Sep 21 16:04:31 snens systemd[6672]: Starting sandboxed app permission store...
Sep 21 16:04:31 snens systemd[6672]: Started sandboxed app permission store.
Sep 21 16:04:31 snens systemd[6672]: Started flatpak document portal service.
Sep 21 16:04:31 snens systemd[6672]: Starting Portal service (GTK/GNOME implementation)...
Sep 21 16:04:31 snens systemd[6672]: Started Portal service (GTK/GNOME implementation).
Sep 21 16:04:31 snens systemd[6672]: Started PipeWire Multimedia Service.
Sep 21 16:04:31 snens systemd[6672]: Started Multimedia Service Session Manager.
Sep 21 16:04:41 snens systemd[6672]: xdg-desktop-portal.service: start operation timed out. Terminating.
Sep 21 16:04:41 snens systemd[6672]: swaync.service: start operation timed out. Terminating.
Sep 21 16:04:41 snens systemd[6672]: xdg-desktop-portal.service: Failed with result 'timeout'.
Sep 21 16:04:41 snens systemd[6672]: Failed to start Portal service.
Sep 21 16:04:41 snens systemd[6672]: swaync.service: Failed with result 'timeout'.
Sep 21 16:04:41 snens systemd[6672]: Failed to start Swaync notification daemon.
Sep 21 16:04:41 snens systemd[6672]: Reached target Current graphical user session.
Sep 21 16:04:41 snens systemd[6672]: Reached target sway compositor session.

The following change to my home configuration has solved the problem:

diff --git a/home/personal/default.nix b/home/personal/default.nix
index 6b4ea17f..2a64318c 100644
--- a/home/personal/default.nix
+++ b/home/personal/default.nix
@@ -1028,6 +1028,14 @@
 
   systemd.user = {
     startServices = "sd-switch";
+    services.swaync = {
+      Install.WantedBy = lib.mkForce [ "sway-session.target" ];
+      Unit = {
+        PartOf = lib.mkForce [ "sway-session.target" ];
+        After = lib.mkForce [ "sway-session.target" ];
+        Requires = lib.mkForce [ "sway-session.target" ];
+      };
+    };
     services.swayidle = {
       Service.Environment = lib.mkForce [
         "PATH=${pkgs.lib.makeBinPath [ pkgs.systemd ]}"

I'm not entirely sure why which is why I didn't file a PR yet.
Does it make sense to make the target configurable here via systemdTarget as it's the case in other modules?

Maintainer CC

cc @9p4 @rycee @abayomi185

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.6.51, NixOS, 24.05 (Uakari), 24.05.20240917.264df05`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.92.0-devpre20240912_b2fc007
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/ma27/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/ma27/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/ma27/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/ma27/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/0v5fask55ncglmxgyv2qpgh99psa9x1d-lix-2.92.0-devpre20240912_b2fc007/share`
 - nixpkgs: `/nix/store/c39iadwxkfkzmpq6a1wyn8bs24d265gp-sjlar9fnb5zw4i8wijpn7gbl2xr3rycq-source`

hm is at revision 208df2e.

@Ma27 Ma27 added bug triage Issues or feature request that have not been triaged yet labels Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

4 participants