Add google account in KDE?

I would like to enable KIO GDrive to access google drive from dolphin. I added the following code to my home manager config.

home.packages = with pkgs; [
      ...
      libsForQt5.kaccounts-integration
      libsForQt5.kaccounts-providers
      libsForQt5.kio-gdrive
      ...
];

Now In the online accounts system settings option if I try to add a google account nothing happens. I was able to successfully add a Nextcloud account but google fails.

journalctl --user shows the following info

Jan 12 21:27:11 nixos krunner[60383]: file:///nix/store/s6v6si8h6wdwaz9sbyshlq4vwbgbx720-kaccounts-integration-22.12.0/share/kpackage/kcms/kcm_kaccounts/contents/ui/AvailableAccounts.qml>
Jan 12 21:27:12 nixos krunner[60383]: "google"
Jan 12 21:27:12 nixos krunner[60383]: Looking for plugin ""
Jan 12 21:27:12 nixos krunner[60383]: Starting auth session with "oauth2"
Jan 12 21:27:12 nixos krunner[60383]: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name com.google.code.AccountsSSO.SingleSignOn was not provided by any .service files")
Jan 12 21:27:13 nixos krunner[60383]: "google"
Jan 12 21:27:13 nixos krunner[60383]: Looking for plugin ""
Jan 12 21:27:13 nixos krunner[60383]: Starting auth session with "oauth2"
Jan 12 21:27:14 nixos krunner[60337]: QCommandLineParser: argument list cannot be empty, it should contain at least the executable name
Jan 12 21:27:14 nixos krunner[60337]: kf.sonnet.core: No language dictionaries for the language: "en_US"

Doing a find in the nix store I was able to find the following file
/nix/store/070n0spa6xa7lxb8xdlxj95lzjm3ycjv-signond-8.61/share/dbus-1/services/com.google.code.AccountsSSO.SingleSignOn.service

My understanding is that kaccounts isn’t able to detect this file for some reason? How would I go around fixing this issue?

Interestingly, it turns out there was a Google Drive Icon inside the Network section in dolphin and when I clicked on it I was able to access my google drive. I am still unable to add my google account in the Online accounts settings page but I am able to access google drive in dolphin. So I don’t care much about this issue anymore.

Do you use two factor authentication on your Google account? Because I can similarly get to the login screen, but I cannot login, as the app is “blocked”, and I’m trying to pinpoint where exactly the error is (KDE itself, missing tokens in NixOS, …)

i can’t login because window login is not showing

any sucess anyone? using kde also

I think it’s blocked as it is an unsecure app you but should be able to disbable this in your google account settings (https://myaccount.google.com/lesssecureapps)

not a nixos solution but works flawlessly in fedora 39 kde

I had adding of Nextcloud’s account also failing, causing systemsettings’s window disappearing but leaving its process running. When that happens there’s this same error that OP had:

QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name com.google.code.AccountsSSO.SingleSignOn was not provided by any .service files")

Adding pkgs.libsForQt5.signond to installed packages fixes the error and allows adding the account successfully. Perhaps that would help with adding a google account as well?