kdePackages: add signon-plugin-oauth2, signon-ui, signond wrapper, nixos/signond module#517355
kdePackages: add signon-plugin-oauth2, signon-ui, signond wrapper, nixos/signond module#517355StarGate01 wants to merge 5 commits into
Conversation
|
Is this AI generated? |
|
I did use Claude to help write the PR description (Is there a policy on AI use in nixpkgs?), because I wanted to document the issues leading up to this for the future - esp. The KDE gdrive blocking was worth linking to imho. The code largely came from #343023, which I rebased and trimmed down, and then made sure everything worked on my system. |
Co-Authored-By: Marie Ramlow <me@nycode.dev>
Co-Authored-By: Christoph Honal <christoph.honal@web.de>
|
Honestly, I don't want to be responsible for maintaining this going forward, especially given upstream's extremely-dead state. Is there a reason you can't use something like rclone instead? |
|
Okay. I will move it into a out-of-tree overlay then, so it does not have to be maintained in nixpkgs. Thank you for confirming! The reson I did not want to use rclone (or other syncing tools), is that I like to use the "virtualized" lazy-loaded folder view in Dolphin, which allows me to browse my (huge) drive, without syncing everything down. Anyway, closing this in favor of having it out of tree. |
|
|
|
(iunno why I was pinged, but I might as well chime in) Lomiri and SailfishOS also use accounts-sso stuff. Given that the Lomiri Qt6 porting board includes tickets for porting accounts-sso software to Qt6 / CMake upstream, I doubt that porting off of that stack is currently being considered / worked on. I have really low time & desire to get this stuff actually working properly though, as it doesn't really come up in my desktop usage (#340391), so I wouldn't be able to review & test this (or even know if it would affect the Lomiri desktop)…
An initial one is currently being worked out: #514587 |
This PR adds the missing pieces of the KDE Online Accounts / accounts-sso stack for Qt6. Once
services.signond.enable = trueis 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) tipkdePackages.signon-ui- D-Bus daemon that opens the OAuth browser window during account loginkdePackages.signond- wraps the bare signond with a composable plugin list viasymlinkJoin, setsSSO_PLUGINS_DIR/SSO_EXTENSIONS_DIR, and patches the D-Bus.servicefile to point at the wrapper so D-Bus activation picks up the pluginsnixos/services/desktops/signond- new NixOS module (services.signond) withenable,package, andpluginsoptions; defaults tosignon-plugin-oauth2+signon-kwallet-extension; also registerssignon-uiinenvironment.systemPackagesso D-Bus can activate it when signond requests an auth UIkdePackages.kaccounts-providers- gainsgoogleClientId,googleClientSecret,withGoogleDriveScope, andwithYoutubeScopeoverride arguments for build-time credential and scope substitutionUsage
Enable the daemon and add the relevant packages to your system:
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-providersexposes override arguments to substitute credentials and control which scopes are requested:googleClientId/googleClientSecret- replace the KDE OAuth app credentials with your ownwithGoogleDriveScope- add thedrivescope (defaultfalse)withYoutubeScope- keep theyoutube.uploadscope (defaulttrue)These are build-time substitutions into
google.provider, so they are package override arguments, not NixOS module options. Apply them via an overlay:The KDE credentials are left untouched by default. Users who want Drive access must supply credentials that are approved for the
drivescope - 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.nixis 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:
plasma6.nixremoved (see above)services.signondmodule has sensible defaults (packagedefaults tokdePackages.signond,pluginsdefaults to[signon-plugin-oauth2, signon-kwallet-extension]) so a minimalservices.signond.enable = true;is sufficientBackground and prior art
Previous packaging attempts in nixpkgs
User reports: signon-plugin-oauth2 / signon-ui missing from NixOS
Root cause:
userActionFinished error: 2= missing signon-uiThe 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
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.