Skip to content

Conversation

@JuneStepp
Copy link
Contributor

There's no need to update the version in user config if no config schema change has occurred. Only saving the config when necessary, solves issues with using this add-on on NixOS.

@BlueGreenMagick
Copy link
Collaborator

BlueGreenMagick commented Oct 12, 2025

Thanks for the PR!

However, I did have a reason for saving last-used addon version.

In the past, one of my addon's minor version update had an issue that broke user data. After that incident I like to store the last opened add-on version, so I can run some script to reverse the breakage as part of migration.

I'm not sure what may be the best solution here. Does Nix perhaps have a config to ignore that warning for a specific addon?

cc. @musjj

Edited: realized after reading again that the solution indeed wouldn't work and removed it.

@JuneStepp
Copy link
Contributor Author

JuneStepp commented Oct 12, 2025

How I handle this in my code is I have a specific config format/schema, in my case represented as a Python class. The config is never edited directly. Rather, the class is serialized and de-serialized. Whenever that schema is changed in a non backwards compatible way, the schema version is updated too. This way, the config is never in an unexpected state.

@JuneStepp
Copy link
Contributor Author

I think I'll just include this patch in the Nix version and close the PR. ReColor can't edit the Nix config, so there's no chance of ReColor accidentally breaking the config in an update there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants