KDE on NixOS, issues

I decided to try KDE (or Plasma) as a desktop environment on my NixOS machine. What I did was simply this:

  services.xserver.displayManager.sddm.enable = true;
  services.xserver.desktopManager.plasma5.enable = true;

With this, I can login and use Plasma. Great! But there are at least two issues: First of all, trying “kmail” using “nix-shell -p kmail --run kmail” I run into a problem:

org.kde.pim.akonadicore: Failed to request resource "" : "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"

What’s this about?

Somewhat similarly, I get random popups from “Kwallet” (for example, directly after logging in). Is that something I need to enable and/or manage separately?

I have the feeling that my config needs some tweaking to “really” use KDE/Plasma. Did I forget something?

What’s this about?

You need to bring in akonadi and friends:

environment.systemPackages = with pkgs; [ akonadi akonadiconsole akonadi-search ];

You can add the various other components as well as kmail to that list as well.

Somewhat similarly, I get random popups from “Kwallet” (for example, directly after logging in). Is that something I need to enable and/or manage separately?

They’re not random - it when an application tries to access an item in kwallet and the specific wallet hasn’t been unlocked yet.

You can also add kwalletmanager to the list above to have that available to see what’s going on.

2 Likes

Ah, I see, thanks! It doesn’t find akonadiconsole and akonadi-search, not sure why…And just akonadi isn’t enough to satisfy kmail.

The whole thing might be something worthwhile to add to one of the manuals maybe, for people who want to use KDE with NixOS.

Ah, I see, thanks! It doesn’t find akonadiconsole and akonadi-search, not sure why…

Because I didn’t get enough context from the output of my grep command and thus provided you bad intel. Sorry.

Only akonadi is available at the top level - the others are nested:

environment.systemPackages = with pkgs.libsForQt5.kdeApplications; [ akonadi akonadiconsole akonadi-search ];

The whole thing might be something worthwhile to add to one of the manuals maybe, for people who want to use KDE with NixOS.

Completely agree. Despite quite a number of people having done lots of great work on developer documentation, when it comes to the end-user side of things, we’re sorely lacking.

Any chance you could be persuaded to document things as you go along?

1 Like

I think so! From the Nix Wiki I can see how to contribute to the documentation, I’ll try adding a few sentences. :slight_smile:

2 Likes

No worries! However, kmail still doesn’t work, although akonadictl status now gives me:

[nix-shell:~]$ akonadictl status
Akonadi Control: running
Akonadi Server: running
Akonadi Server Search Support: available (Remote Search, Akonadi Search Plugin)
Available Agent Types: akonadi_indexing_agent, akonadi_knut_resource

So I don’t actually use kmail but it looks like it’s missing some akonadi plugins. Have you tried adding everything you can find with akonadi in it like akonadi-calendar, akonadi-contacts, akonadi-mime and so on?

I tried adding these, and it doesn’t help.
I think the real issue is here (from the kmail log):

Cannot initialize model with data QJsonObject() . missing: QJsonValue(string, “urls”)

Also, it is worrying to me that this situation is not considered a bug.

It does absolutely sound like a bug. Can I trouble you to open an issue please?

If anyone comes across this, I had to install akonadi and start the server by hand (akonadiserver) once, to initialize the db.

2 Likes

Worked for me after I added all the libsForQt5.akonadi* and libsForQt5.kdepim* packages to systemPackages. Not sure which packages are actually necessary.

1 Like

Filed a bug on everyone’s behalf. Please consider filing bugs in the future. Thank you.

https://github.com/NixOS/nixpkgs/issues/266565

Edit: I tried this command – did not work for me:

nix-shell -p kmail -p libsForQt5.akonadiconsole -p libsForQt5.akonadi -p libsForQt5.akonadi-search -p libsForQt5.akonadi -p libsForQt5.akonadi-calendar -p libsForQt5.akonadi-calendar-tools -p libsForQt5.akonadi-contacts -p libsForQt5.akonadi-import-wizard -p libsForQt5.akonadi-mime -p libsForQt5.akonadi-notes -p libsForQt5.akonadi-search -p libsForQt5.akonadiconsole -p libsForQt5.kdepim-addons -p libsForQt5.kdepim-runtime --command kmail