FAQ/When do I update stateVersion: Difference between revisions
This is a complete rewrite of the page, adding more information, better references, and attempting to make it more clear that the value should never be changed; The old version was dangerously close to implying it could reasonably be changed. |
→What even is system.stateVersion for, if it is just an unchanging string?: Clarify the perceived intent of `system.stateVersion` Tags: Mobile edit Mobile web edit |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{FAQ/breadcrumb}}<onlyinclude> | {{FAQ/breadcrumb}}<onlyinclude> | ||
{{Warning|<strong><code>system.stateVersion</code> should never be updated</strong>}} | |||
== Why am I told not to update<ref name=":0">https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion</ref> <code>system.stateVersion</code>? == | == Why am I told not to update<ref name=":0">https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion</ref> <code>system.stateVersion</code>? == | ||
| Line 27: | Line 29: | ||
== What even is <code>system.stateVersion</code> for, if it is just an unchanging string? == | == What even is <code>system.stateVersion</code> for, if it is just an unchanging string? == | ||
Currently, this is undefined<ref name=":1" />, though the intent is to keep track of on-disk state versions that are not supposed to change with the configuration. | |||
As a result, modules can effectively use <code>system.stateVersion</code> for anything, which makes the effects of changing it unpredictable. | |||
Since it is sometimes used to protect data integrity upon package updates, changing the number can lead to irreversible data loss. | |||
== References == | == References == | ||
</noinclude> | </noinclude> | ||