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
add support to render quoteless strings in gvariant #1397
Conversation
61de69d
to
bf5d192
Compare
in dconf some things are easily represented by a string but must not be a quoted string for example value `@mb true` describes a type maybe boolean and its value is true. currently home-manager is rendering this as '@mb true' which is stored in dconf but does not operate properly. using mkRawString "@mb true" does work as it writes a quoteless string in the ini
bf5d192
to
d30e0ea
Compare
I guess a possible better feature would be able to render variables in this same format, but this was what i needed to fix my small issue. |
I added support for maybe instead: https://rycee.gitlab.io/home-manager/index.html#sec-option-types |
thanks solves that one. i havent tried yet but what about a more complex data type like
|
Variants are not supported yet but it shouldn't be a problem to add support for them. |
i think rawstrings or extraConfig is a good way to sidestep issues like that though. |
I'm not a fan of raw strings in this case. It would mean admitting defeat in ever having this data type being used for anything beside serializing to text. Which kind of bypasses the entire need for having a data type in the first place. I assume you are wanting to load stuff into dconf? If so and you want to work with raw GVariant text then I would recommend simply creating an activation block that runs, e.g., |
i have been playing with impermanence from nix-community, so it is my goal to have all my dconf state defined. those complex blobs and the @mb where the only things not converted correctly. so i have them special cased now with my own mkRawString. I would love to be able to do it type for type, but I understand that is not a priority thats why i would think extraConfig might be right stop gap procedure. but setup is working for me now, so thank you. |
Description
Some of the values in my dconf settings ini file need to be quoteless strings,
@mb true
for example when rendered with quotes does not set the value for bluetooth correctly as its a string and not a maybe type boolean set to true.but if pass mkRawString "@mb true" in it writes the correct key=@mb true to the file.
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Added myself as module maintainer. See example.
Added myself and the module files to
.github/CODEOWNERS
.