diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-07-27 19:46:36 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-07-27 20:30:09 +0200 |
commit | d166c854b6ecfd9ada520439b06f7eb9e3e4be7c (patch) | |
tree | 2f94ab69034b71c912ef5d477ecd141979089a2f /nixos/modules/installer/tools/nixos-generate-config.pl | |
parent | e3a5bca4ae3737dbe0ff2675d1fd77fdf72db609 (diff) | |
download | nixlib-d166c854b6ecfd9ada520439b06f7eb9e3e4be7c.tar nixlib-d166c854b6ecfd9ada520439b06f7eb9e3e4be7c.tar.gz nixlib-d166c854b6ecfd9ada520439b06f7eb9e3e4be7c.tar.bz2 nixlib-d166c854b6ecfd9ada520439b06f7eb9e3e4be7c.tar.lz nixlib-d166c854b6ecfd9ada520439b06f7eb9e3e4be7c.tar.xz nixlib-d166c854b6ecfd9ada520439b06f7eb9e3e4be7c.tar.zst nixlib-d166c854b6ecfd9ada520439b06f7eb9e3e4be7c.zip |
Add option system.stateVersion
This option requests compatibility with older NixOS releases with respect to stateful data, in cases where new releases have defaults that might be incompatible with system state of existing NixOS deployments. For instance, if we change the default version of PostgreSQL, existing deployments will break if the new version can't read databases created by the old version. So for example, setting system.stateVersion = "15.07"; requests that options like services.postgresql.package use defaults corresponding to the 15.07 release branch. Note that nixos-generate-config emits this option. (In the future, NixOps may set system.stateVersion to the NixOS release in use when the machine was created.) See also #7939 for another motivating example.
Diffstat (limited to 'nixos/modules/installer/tools/nixos-generate-config.pl')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 187ea7635eb5..9010478662cc 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -544,6 +544,9 @@ $bootLoaderConfig # uid = 1000; # }; + # The NixOS release to be compatible with for stateful data such as databases. + system.stateVersion = "@nixosRelease@"; + } EOF } else { |