diff options
Diffstat (limited to 'nixos/modules/misc/version.nix')
-rw-r--r-- | nixos/modules/misc/version.nix | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index 74c86443ab90..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; @@ -12,29 +12,29 @@ in { - options.system = { + options.system.nixos = { - nixos.version = mkOption { + version = mkOption { internal = true; type = types.str; description = "The full NixOS version (e.g. <literal>16.03.1160.f2d4ee1</literal>)."; }; - nixos.release = mkOption { + release = mkOption { readOnly = true; type = types.str; default = trivial.release; description = "The NixOS release (e.g. <literal>16.03</literal>)."; }; - nixos.versionSuffix = mkOption { + versionSuffix = mkOption { internal = true; type = types.str; default = trivial.versionSuffix; description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>)."; }; - nixos.revision = mkOption { + revision = mkOption { internal = true; type = types.str; default = if pathIsDirectory gitRepo then commitIdFromGitRepo gitRepo @@ -43,7 +43,7 @@ in description = "The Git revision from which this NixOS configuration was built."; }; - nixos.codeName = mkOption { + codeName = mkOption { readOnly = true; type = types.str; description = "The NixOS release code name (e.g. <literal>Emu</literal>)."; @@ -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 |