about summary refs log tree commit diff
path: root/nixos/modules/installer/tools
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/installer/tools')
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl3
-rw-r--r--nixos/modules/installer/tools/tools.nix1
2 files changed, 4 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 {
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 {