How to configure KDE properly in Nix?

The following problem statement reflects how I perceive the KDE configuration landscape at the moment. If something is factually incorrect, please say so!


In reality,


  • Users who wish to configure KDE declaratively can’t.
  • Users who want to have a reproducible KDE setup resort to manual dotfile management to some degree.

Yes, KDE is not as well-integrated with NixOS as other window managers. Part of the reason is that KDE is sprawling, even just plasma+Kwin. Other part is that few people in Nix community understand KDE+Plasma well enough to keep the lights up, and they are already busy enough with regular updates.

Unfortunately until we find more volunteers in this area, it is hard to see status quo changing.

Thank you, though, for bringing this up. It does help to keep the topic in public view on semi-regular basis.


Can you clarify specifically what you mean by configure? I came across your post here, while I am in the process of figuring out how to duplicate options for dolphin, kwin, konsole, etc across machines. Things like setting up toolbars, color schemes, plugins. Is this what you are talking about? “configure” is a pretty broad word when applied to an entire desktop environment.

If you are trying to do what I am, it does not appear that there is anything in nixpkgs that is helpful atm, but I’m definitely going to figure something out at least for myself. I do not intend on making a fleshed out module but I’m willing to share what I come up with as a basis for anyone else.

1 Like

See also and this ongoing project


Did u ens up achieving this as i would like to know as well

My dirty solution to turn off baloo by default, and setup default hotkeys (which can all be overridden in a users config) is like this:

environment.etc = let
    kdeGlobalConfigFiles = lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair
    ( "xdg/${name}" ) ({source = (pkgs.formats.ini {}).generate name value; }));
    "kglobalshortcutsrc" = (import ./kglobalshortcutsrc.nix);
    "baloofilerc" = {
      "Basic Settings" = {
        "Indexing-Enabled" = false;

where kglobalshortcutsrc.nix (shortened for this purpose) looks like this:

  "khotkeys" = {
    "{30ec4148-5ee5-4110-8ffb-ec0cfae00274}" = "Meta+Ctrl+K,none,keepassxc";
    "{96be09be-2c15-4507-88c2-2cad79816ccc}" = "Alt+Shift+Return,none,konsole";

  "ksmserver" = {
    "Lock Session" = "Meta+L\tCtrl+Alt+L\tScreensaver,Meta+L\tScreensaver,Lock Session";

  "kwin" = {
    "Switch to Next Desktop" = "none,,Switch to Next Desktop";
    "Switch to Next Screen" = "none,,Switch to Next Screen";
    "Switch to Previous Desktop" = "none,,Switch to Previous Desktop";
    "Switch to Previous Screen" = "none,,Switch to Previous Screen";
    "Window One Desktop Down" = "Meta+Ctrl+Shift+Down\tCtrl+Alt+Shift+Down,Meta+Ctrl+Shift+Down,Window One Desktop Down";
    "Window One Desktop Up" = "Ctrl+Alt+Shift+Up\tMeta+Ctrl+Shift+Up,Meta+Ctrl+Shift+Up,Window One Desktop Up";
    "Window One Desktop to the Left" = "Meta+Ctrl+Shift+Left\tCtrl+Alt+Shift+Left,Meta+Ctrl+Shift+Left,Window One Desktop to the Left";
    "Window One Desktop to the Right" = "Meta+Ctrl+Shift+Right\tCtrl+Alt+Shift+Right,Meta+Ctrl+Shift+Right,Window One Desktop to the Right";

    "Window Operations Menu" = "Alt+F3,Alt+F3,Window Operations Menu";

    "view_actual_size" = "none,Meta+0,Zoom to Actual Size";
    "view_zoom_in" = "Meta+,Meta++,Zoom In";
    "view_zoom_out" = "Meta+-,Meta+-,Zoom Out";

    "Switch One Desktop Down" = "Ctrl+Alt+Down,Meta+Ctrl+Down,Switch One Desktop Down";
    "Switch One Desktop Up" = "Ctrl+Alt+Up,Meta+Ctrl+Up,Switch One Desktop Up";
    "Switch One Desktop to the Left" = "Ctrl+Alt+Left,Meta+Ctrl+Left,Switch One Desktop to the Left";
    "Switch One Desktop to the Right" = "Ctrl+Alt+Right,Meta+Ctrl+Right,Switch One Desktop to the Right";

    "Overview" = "Meta+W,Meta+W,Toggle Overview";
    "Show Desktop" = "Meta+D,Meta+D,Peek at Desktop";

    "Suspend Compositing" = "Alt+Shift+F12,Alt+Shift+F12,Suspend Compositing";

    "Switch Window Down" = "Meta+Alt+Down,Meta+Alt+Down,Switch to Window Below";
    "Switch Window Left" = "Meta+Alt+Left,Meta+Alt+Left,Switch to Window to the Left";
    "Switch Window Right" = "Meta+Alt+Right,Meta+Alt+Right,Switch to Window to the Right";
    "Switch Window Up" = "Meta+Alt+Up,Meta+Alt+Up,Switch to Window Above";

ideally, there could be a much more idiomatic way to write the Nix portion, since what I’m doing here is not far from simply keeping the settings files in my nixos git repo, and putting the files in /etc

I think that I have seen somewhere in nixpkgs a formatter for kde config files, but they are basically ini files and the value types are not consistent across programs even though its all plasma/kde. Hopefully this is enough to get you started though.

You might consider also just copying configuration from a clean user install to your nixos directory, removing unnecessary parts, then setting environment.etc to put those files in /etc/xdg. My solution might be a waste of effort and prone to breakage. The baloofilerc part looks fine, but the kglobalshortcutsrc part looks like a nightmare. It’s clear why this stuff isn’t already in NixOS. Not only would special rules need to be in place for every program, but tests would be hard to write and every update could cause breakage.

Despite all that, over time, I think a nice solution will come out. I wrote my initial response here over a year ago, and only got around to writing and testing my lazy solution a few months ago.

/etc/xdg/${kde rc filename} only covers configurations stored in ~/.config. I believe there is a way to set systemwide configuration for files that end up in ~/.local/share but I’ve no tried yet. Heavily customized kde distros may provide hints.