From 1f0b6922d3c2de3da235a7075d0d3cb9255b7cd7 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Thu, 22 Feb 2018 21:31:57 +0000 Subject: [PATCH] nixos: version: produce a warning when no `system.nixos.stateVersion` is explicitly set --- nixos/modules/misc/version.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index c45d5b077481..33d8a7861693 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