Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/lib/testing.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ in rec {
networking.hostName = "client";
nix.readOnlyStore = false;
virtualisation.writableStore = false;
system.stateVersion = "19.09"; # TODO: determine automatically
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this TODO ought to be resolved before merging this, as otherwise we'll forget it after 19.09 branch-off, and we'll start testing outdated versions of postgresql on the next postgresql bump (or similar thing that would involve bumping stateVersion)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving it a bit more thought: either that or just add bumping this to the release process checklist, maybe -- definitely need to record the existence of this TODO somewhere at least, though.

}
];

Expand Down
23 changes: 13 additions & 10 deletions nixos/modules/misc/version.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,20 @@ in

stateVersion = mkOption {
type = types.str;
default = cfg.release;
# Deliberately no default, as automatically upgrading the stateVersion can
# lead systems to stop working.
example = cfg.release;
description = ''
Every once in a while, a new NixOS release may change
configuration defaults in a way incompatible with stateful
data. For instance, if the default version of PostgreSQL
changes, the new version will probably be unable to read your
existing databases. To prevent such breakage, you can set the
value of this option to the NixOS release with which you want
to be compatible. The effect is that NixOS will option
defaults corresponding to the specified release (such as using
an older version of PostgreSQL).
This option exists to prevent breakage for NixOS modules that depend on
state which can't be controlled by them. The value of this option
represents the <em>initial</em> NixOS version installed, and should
therefore <em>not</em> be ever changed unless you make sure to run all
necessary migrations yourself. By fixing this value, NixOS modules can
know what version your state is in, such that they can make incompatible
changes for new installations, without breaking the module for all
existing installations. For example this is used in the postgresql
module, where a new module version uses a newer postgresql version which
can't read the databases of older versions.
'';
};

Expand Down