Config KDE (and posibbly KDE core apps) via API
Open, WishlistPublic

Description

Description

  • What do you want to improve/change/...?
I would like to config KDE top to bottom via Configuration-As-Code, somthing similer to dconf in Gnome
  • Why does it need to be done?
Create a reprudicible config which be ported/duplicated/shared ...
  • How would it affect different parts of KDE?//
All application will have to come under the same API framework, so you won't have to config each application in a diffrent tools, or diffrent config files

What it will take

What is your plan for making it happen? What do we need to do to make this reality? What kind of support do you need?

How we know we succeeded

If we could clone one setup simple by 

$ kdeconfig --dump | ssh new-machine -- kdeconfig --restore
or
$ curl https:// ... | kdeconfig --restore

Relevant links

Any links that will help people find more information and understand the goal better?

Champions

We want this year's goals to be driven by small teams. Who will be these goals champions if selected? If you don't yet have a small team, please mention what you are looking for still so others can step up. We believe a goal generally needs someone who can carry the vision of the goal forward, someone who can technically steer it and someone to promote it.

The team is:

  • XXX
  • XXX
  • XXX

I am willing to put work into this

  • add your name

I am interested

  • add your name
jhgkhv created this task.Jun 9 2024, 9:32 AM
lydia added a subscriber: lydia.Jun 14 2024, 6:02 PM

Each goal needs Champions. If no-one is found it will unfortunately not be eligible for voting.

lydia triaged this task as Wishlist priority.Jun 14 2024, 6:28 PM

As an example implementation, here is how we implemented a similar functionality in home-manager https://github.com/pasqui23/home-manager/blob/e2e7ea9b8f3de1e6a09f4fc512eae75f6e413a10/modules/misc/qt/kconfig.nix#L19

There is already k{read,write}config{5,6}. It would only need a switch to dump all configuration and a list of all files to dump (which is harder as they are not consistently in the same place).

So less of a large goal and more of a feature request.

Please note that my intention was not the implementation of DUMPALL, but the idea that all programs expose their configuration through a uniform API, something that would allow the implementation of DUMPALL, among other things, but mainly definitions through code. So tools like ANSIBLE (or NIX) can configure the entire system through one interface.

Speaking for nix, a bigger obstacle was the fact that for many applications config and state were mixed together in the same file, so we couldn't simply symlink that config file to the read only nix store

Home-manager solved this by using kwriteconfig to write the corresponding config entries instead. But yes a dump tool would be nice to help migrate.

frdbr added a subscriber: frdbr.Jul 29 2024, 3:53 PM
frdbr added a comment.Aug 12 2024, 7:39 PM

Hello,

Please note that the deadline just around the corner on Wednesday, so now is the time to finalize your proposal. Remember that proposals without a Goal Champion will be disqualified, so this step is crucial to ensure your idea moves forward. If you need help or have any questions, please let me know.

If you’re unable to finish your proposal but still want to participate, consider contributing to other ongoing tasks.

Thank you for submitting your ideas for the KDE Goals!

All application will have to come under the same API framework, so you won't have to config each application in a diffrent tools, or diffrent config files

All applications already use a common framework (KConfig), so it's unclear to me what needs to be done here

Hi @nicolasfella

Can we backup/restore all KDE config into a single file?
Can I clone someone RICE from reddit simple by curl url | kdeconf --restore
Or even something like curl url | kdeconf --restore --dry-run which will print all the key/values which will be changed.

My main though was to have something like we had with dconf where you can use tools like Ansible to bring a desktop to a specific state, via API calls

Hope that make sense :)

The proposal talks about adding "API" for configuration management, but we already have means to do that (KConfig from C++ and CLI tools like kreadconfig/kwriteconfig).

What we don't have is a single command to back up/restore stuff, but that's something that could be added on top of the existing framework, it doesn't require a new framework.

There's a few things that make working with the existing configuration difficult:

  • Sometimes state and config are mixed. This is a solved problem in KConfig, the solution just needs to be consistently applied by application developers
  • Not all configuration data can just be copied and pasted across machines, and there is no indication where that's the case
  • It's not very discoverable which configuration options exist without reading the source code
  • config files are generally treated as implementation details of the software, not something a user is expected to manually mess with
  • For legacy reasons (or no reason at all really) configuration is split into more files than necessary or in inconsistent location

Most of these aren't limitations of the config framework we have but rather how it gets used by applications. Addressing that is possible, but requires a lot of nitty-gritty work on individual applications

I will try to clarify my proposal, let's ignore for a moment what I wrote about API, and focus on the result, and from there you can tell me what is the right way to get there.

What I propose is the possibility to configure every possible option of KDE through one interface, (and that this interface will also make it possible to read the information from it). And in this way to open the option of Configuration-as-Code. To allow tools like ANSIBLE or NIX to easily configure the entire DE end-to-end. And the wet dream is the option to easily export and import these settings, as I described above.

I'm aware that the KDE configuration files are scattered in several places, and I guess that in the first step maybe we should gather them all in one place.

I hope I managed to convey my intention more clearly :)

To add on this while the Home Manager's module allows to configure KDE apps declaratively it is also impure, if I remove some sonfiguration from home.nix the configuration in the home directory remains, unlike with other programs that Properly respect the xdg division between config, cache and state.

An easy way to improve on the status quo would be to change KConfig such that it search configuration in $XDG_CONFIG_DIRS, not only in $XDG_CONFIG_HOME