home.stateVersion is not of type `one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11"'

 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.43, NixOS, 22.05 (Quokka), 22.05.751.8b66e3f2ebc`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(root): `"home-manager-22.05.tar.gz, nixos-22.05"`
 - channels(usere): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
error: A definition for option `home.stateVersion' is not of type `one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11"'. Definition values:
       - In `/home/user/home.nix': "22.05"

What is happening? Tried to upgrade from 21.11 like I did with two other devices before …

When updating from one version to the other, then you do not touch the stateVersion ever. Instead you add the new channel, run a channel update and after that you rebuild/switch.

The stateVersion does not get bumped unless you know exactly why you do it.

1 Like