summary refs log tree commit diff
path: root/nixos/modules/misc/version.nix
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2018-02-22 21:31:57 +0000
committerJan Malakhovski <oxij@oxij.org>2018-05-12 19:27:10 +0000
commit1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7 (patch)
tree9424f5d4360793bfd836534cb852f036ad9198eb /nixos/modules/misc/version.nix
parent4017fdcafdd4a1a2063b74bc46c744c85ffcc22e (diff)
downloadnixpkgs-1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7.tar
nixpkgs-1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7.tar.gz
nixpkgs-1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7.tar.bz2
nixpkgs-1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7.tar.lz
nixpkgs-1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7.tar.xz
nixpkgs-1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7.tar.zst
nixpkgs-1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7.zip
nixos: version: produce a warning when no `system.nixos.stateVersion` is explicitly set
Diffstat (limited to 'nixos/modules/misc/version.nix')
-rw-r--r--nixos/modules/misc/version.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index c45d5b07748..33d8a786169 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -1,4 +1,4 @@
-{ config, lib, pkgs, ... }:
+{ options, config, lib, pkgs, ... }:
 
 with lib;
 
@@ -76,6 +76,9 @@ in
 
   config = {
 
+    warnings = lib.optional (options.system.nixos.stateVersion.highestPrio > 1000)
+      "You don't have `system.nixos.stateVersion` explicitly set. Expect things to break.";
+
     system.nixos = {
       # These defaults are set here rather than up there so that
       # changing them would not rebuild the manual