summary refs log tree commit diff
path: root/nixos/release.nix
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2023-05-15 10:38:56 +0200
committerJörg Thalheim <Mic92@users.noreply.github.com>2023-09-03 16:32:37 +0200
commit3a5ff9a68c9dbb8b707555d44988575b3e9544bf (patch)
treea0d286c714df0fca66057d0355884f48830fa3dd /nixos/release.nix
parentc9956c110efd3465baac083aa4506daaef0678ce (diff)
downloadnixpkgs-3a5ff9a68c9dbb8b707555d44988575b3e9544bf.tar
nixpkgs-3a5ff9a68c9dbb8b707555d44988575b3e9544bf.tar.gz
nixpkgs-3a5ff9a68c9dbb8b707555d44988575b3e9544bf.tar.bz2
nixpkgs-3a5ff9a68c9dbb8b707555d44988575b3e9544bf.tar.lz
nixpkgs-3a5ff9a68c9dbb8b707555d44988575b3e9544bf.tar.xz
nixpkgs-3a5ff9a68c9dbb8b707555d44988575b3e9544bf.tar.zst
nixpkgs-3a5ff9a68c9dbb8b707555d44988575b3e9544bf.zip
nixos/release.nix: remove warning about missing state version for images
Diffstat (limited to 'nixos/release.nix')
-rw-r--r--nixos/release.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/nixos/release.nix b/nixos/release.nix
index 6da6faab73b..377e5700e0d 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -44,10 +44,13 @@ let
   pkgs = import ./.. { system = "x86_64-linux"; };
 
 
-  versionModule =
-    { system.nixos.versionSuffix = versionSuffix;
-      system.nixos.revision = nixpkgs.rev or nixpkgs.shortRev;
-    };
+  versionModule = { config, ... }: {
+    system.nixos.versionSuffix = versionSuffix;
+    system.nixos.revision = nixpkgs.rev or nixpkgs.shortRev;
+
+    # At creation time we do not have state yet, so just default to latest.
+    system.stateVersion = config.system.nixos.version;
+  };
 
   makeModules = module: rest: [ configuration versionModule module rest ];