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
nixos/rootston: Use an attribute set and the new keyboard configuration format #38401
Conversation
This change is not backwards compatible, but rootston isn't intended to be used as a "real" window manager (i.e. it shouldn't break anyone's setup).
cc @Profpatsch In case you're interested (but it's not really an important module) / want to give me some feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Yes I see it's non ideal, but overall is neater and also a new stuff to learn for me :D
description = '' | ||
Default configuration for rootston (used when called without any | ||
parameters). | ||
''; | ||
}; | ||
|
||
extraConfig = mkOption { | ||
type = types.attrs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toINI
only accepts attrsets of attrsets of any
, anything else will make it crash iirc. So this should really be attrsOf (attrsOf undefined)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even better would be an ini
type that only accepts stuff toINI
also accepts, but I haven’t thought that through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Profpatsch Thank you very much for your review and apologies that I had to close this PR.
Closing this PR due to 9db699e and the linked issue. It was probably a bad idea from me to add this module in the first place (I thought it would be useful, but upstream stated that rootston isn't supposed to be packaged and we don't even have a module for Weston - I'll eventually remove this module). - Apologies |
Motivation for this change
Rootston has a new preferred configuration format for the keyboard. E.g. with
sway
it works with environment variables like this:But the new preferred way is via the INI configuration file:
Because the keyboard section is already specified in the default configuration:
It probably makes sense to use an attrset instead. As a result
config
andextraConfig
can be merged automatically and converted to the INI configuration format.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)@gnidorah: Do you have an opinion on this approach? It makes it possible to extend and override the default configuration with extraConfig but it is probably a bit confusing (attrset vs INI), doesn't support comments (only within the Nix code), and doesn't look as nice in the configuration.nix man page (lib.generators.toPretty doesn't really help either).