Skip to content

kdePackages: add signon-plugin-oauth2, signon-ui, signond wrapper, nixos/signond module#517355

Open
StarGate01 wants to merge 6 commits intoNixOS:masterfrom
StarGate01:signon-gdrive
Open

kdePackages: add signon-plugin-oauth2, signon-ui, signond wrapper, nixos/signond module#517355
StarGate01 wants to merge 6 commits intoNixOS:masterfrom
StarGate01:signon-gdrive

Conversation

@StarGate01
Copy link
Copy Markdown
Member

This PR adds the missing pieces of the KDE Online Accounts / accounts-sso stack for Qt6. Once services.signond.enable = true is set, Google Drive becomes accessible via Dolphin and kio-gdrive on NixOS.

What is added

  • kdePackages.signon-plugin-oauth2 - OAuth 1.0/2.0 plugin for signond, pinned to the Qt6-support MR (!28) tip
  • kdePackages.signon-ui - D-Bus daemon that opens the OAuth browser window during account login
  • kdePackages.signond - wraps the bare signond with a composable plugin list via symlinkJoin, sets SSO_PLUGINS_DIR/SSO_EXTENSIONS_DIR, and patches the D-Bus .service file to point at the wrapper so D-Bus activation picks up the plugins
  • nixos/services/desktops/signond - new NixOS module (services.signond) with enable, package, and plugins options; defaults to signon-plugin-oauth2 + signon-kwallet-extension; also registers signon-ui in environment.systemPackages so D-Bus can activate it when signond requests an auth UI
  • kdePackages.kaccounts-providers - gains googleClientId, googleClientSecret, withGoogleDriveScope, and withYoutubeScope override arguments for build-time credential and scope substitution

Usage

Enable the daemon and add the relevant packages to your system:

services.signond.enable = true;

environment.systemPackages = with pkgs.kdePackages; [
  kaccounts-integration
  kaccounts-providers
  kio-gdrive
];

Then open System Settings → Online Accounts, add a Google account, and Google Drive will appear in Dolphin.

The packages are not added automatically because not every user wants kio-gdrive - the module's responsibility is only to run the daemon correctly.

Google Drive scope and custom OAuth credentials

The default KDE OAuth client is not approved by Google for Drive access. kaccounts-providers exposes override arguments to substitute credentials and control which scopes are requested:

  • googleClientId / googleClientSecret - replace the KDE OAuth app credentials with your own
  • withGoogleDriveScope - add the drive scope (default false)
  • withYoutubeScope - keep the youtube.upload scope (default true)

These are build-time substitutions into google.provider, so they are package override arguments, not NixOS module options. Apply them via an overlay:

nixpkgs.overlays = [
  (final: prev: {
    kdePackages = prev.kdePackages.overrideScope (kfinal: kprev: {
      kaccounts-providers = kprev.kaccounts-providers.override {
        googleClientId = "YOUR_CLIENT_ID";
        googleClientSecret = "YOUR_CLIENT_SECRET";
        withGoogleDriveScope = true;
        withYoutubeScope = false;
      };
    });
  })
];

The KDE credentials are left untouched by default. Users who want Drive access must supply credentials that are approved for the drive scope - either their own registered OAuth app or another client that has Google's approval for that scope.

What is deliberately not done

Auto-enabling signond in plasma6.nix is omitted. The accounts-sso upstream is effectively unmaintained (Qt6 support lives in a fork and an open MR), and KDE is actively building a replacement (KOnlineAccounts). Making it opt-in keeps the default Plasma6 configuration clean until the situation upstream stabilises.

Relation to previous PR

This is a rebase and refinement of #343023 ("nixos/plasma6: wrap signond", Sep 2024, closed Oct 2024) by @NyCodeGHG. The core packaging approach (symlinkJoin wrapper, SSO_PLUGINS_DIR) is taken directly from that PR. Differences from #343023:

  • Auto-enabling in plasma6.nix removed (see above)
  • services.signond module has sensible defaults (package defaults to kdePackages.signond, plugins defaults to [signon-plugin-oauth2, signon-kwallet-extension]) so a minimal services.signond.enable = true; is sufficient
  • Version dates corrected to match actual upstream commit timestamps
  • License fields added to both new packages

Background and prior art

Previous packaging attempts in nixpkgs

  • nixos/plasma6: wrap signond #343023 (Sep 2024, closed Oct 2024): comprehensive PR by @NyCodeGHG adding signon-plugin-oauth2, signon-ui, a NixOS signond module, and enabling kaccounts/kio-gdrive by default. Closed after @K900 noted "accounts-sso upstream is effectively already dead, and KDE stuff is moving away from it." NyCodeGHG closed it pending a KDE replacement. Note: as of 2026 no production replacement has materialised and kio-gdrive remains the only working Google Drive solution for KDE.
  • libsForQt5.signond: 8.60 -> 8.61 #164233 (merged Apr 2022): last upstream version bump of signond in nixpkgs, showing it was maintained at the Qt5 level but never ported to Qt6.

User reports: signon-plugin-oauth2 / signon-ui missing from NixOS

Root cause: userActionFinished error: 2 = missing signon-ui

The OAuth browser window is opened by signon-ui. Without it, the D-Bus call from signond returns CommunicationError (error code 2).

Why kio-gdrive stopped working: KDE's OAuth client lost Drive access

In June 2024 Google formally demanded that KDE either remove restricted Drive scopes from its OAuth registration or submit for re-verification within 90 days (or face a 100-user cap and an "unverified app" warning). KDE chose to remove the scope, breaking kio-gdrive for all users.

Future: KOnlineAccounts - the planned replacement

The accounts-sso stack (signond, signon-plugin-oauth2, signon-ui) is effectively unmaintained and KDE is actively working on a replacement. This PR is a stopgap until KOnlineAccounts matures and kio-gdrive or its successor adopts it.


cc @NyCodeGHG @K900 @OPNA2608 @Scrumplex @NickCao

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@nixpkgs-ci nixpkgs-ci Bot requested review from a team, K900, NickCao, SuperSandro2000 and ttuegel May 6, 2026 16:20
@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: qt/kde Object-oriented framework for GUI creation 8.has: module (update) This PR changes an existing module in `nixos/` labels May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: qt/kde Object-oriented framework for GUI creation 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants