about summary refs log tree commit diff
path: root/nixos/modules/installer/tools/tools.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-27 19:46:36 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-27 20:30:09 +0200
commitd166c854b6ecfd9ada520439b06f7eb9e3e4be7c (patch)
tree2f94ab69034b71c912ef5d477ecd141979089a2f /nixos/modules/installer/tools/tools.nix
parente3a5bca4ae3737dbe0ff2675d1fd77fdf72db609 (diff)
downloadnixlib-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/tools.nix')
-rw-r--r--nixos/modules/installer/tools/tools.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix
index 99a74b6d59ed..61744c39d601 100644
--- a/nixos/modules/installer/tools/tools.nix
+++ b/nixos/modules/installer/tools/tools.nix
@@ -40,6 +40,7 @@ let
     src = ./nixos-generate-config.pl;
     path = [ pkgs.btrfsProgs ];
     perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl";
+    inherit (config.system) nixosRelease;
   };
 
   nixos-option = makeProg {