-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial try to add support for immutable settings #94
Initial try to add support for immutable settings #94
Conversation
What do you think about this @toast003. I think it is important that we create an interface which allows for ease of extensibility, and while the project is still in the unstable period, now is the time we can allow for breaking changes for the long-term benefit. |
I could also achieve the same results without having to add |
I agree, I think having to set |
And since you mentioned ease of extensibility I think that after this pr gets merged we could implement |
I can do it right away I think. This draft still needs some tweaks with documentation I think so I'll have to fix that anyway and implementing this should be easy. There also is the |
I just updated my flake reference to pull this PR in and found it's a significant readability regression for my configs :( I think there are two things that could drastically improve the UX:
would allow both
This would mean that the vast majority of definitions don't need an extra
|
The main reason why the old syntax had problems was that it caused overly complicated recursive syntax and implementations, but since we had to do away with the recursive syntax anyway we probably could quite easily re-add support for keys without explicitly adding |
WDYM by "mimics that of home-manager"? Do you mean something like
In places where you are defining nested config that isn't based on file paths, home-manager does allow recursive definitions without any extra fields. For example, To take a real example from my config, can you explain what the "overly complicated recursive syntax" is for programs.plasma.configFile.kcminputrc.Libinput."2362"."628"."PIXA3854:00 093A:0274 Touchpad" = {
ClickMethod = 2; # Two-finger click to right click
TapToClick = true;
TapDragLock = true;
}; versus (if I understand this PR correctly) programs.plasma.configFile.kcminputrc."Libinput/2362/628/PIXA3854:00 093A:0274 Touchpad" = {
ClickMethod.value = 2; # Two-finger click to right click
TapToClick.value = true;
TapDragLock.value = true;
}; ? |
I sent #144 with the |
Ok, I can take a look tomorrow :) |
This will change the files module quite a bit again in order to allow for additional options for the values. Where the values of a key in plasma-manager before was just a bool/int/float and so on, it now will have it's own custom type, which at the moment has two properties, namely "value" and "immutable". Another thing I had to do here was to revert the recursive attributes and go back to an improved version of the old format. While I think that the recursive options solution was good in comparison to what we had, I think it also makes things a lot harder to extend, and may even make some things impossible to distinguish between (you can probably work around this, but not without introducing weird quirks or hacky solutions), and when compared to the old system then becomes quite limiting for what we actually can achieve functionality-wise in plasma-manager. For example I would assume there is a reason why home-manager doesn't take much use of them even though they probably could in some places.
My proposal is not that we should go back to the old format though, which I think wasn't ideal. A new separator which I think makes a lot more sense is "/" as this isn't supported in kde config-file group-names, meaning there should not be any conficts here. I also added an option to escape this with "\\/" just as when we used periods (though I honestly don't think there should be much reason to use this).
A thing I like about this new format is that this will resemble the home-manager interface a lot closer, which I think is natural as this project heavily builds on the ideas of home-manager. If anyone has any good arguments against this (for example @MatthewCash) format feel free to post them here. This should close #89.