summary refs log tree commit diff
path: root/nixos/modules/misc
diff options
context:
space:
mode:
authorLassulus <github@lassul.us>2023-01-05 14:14:09 +0100
committerGitHub <noreply@github.com>2023-01-05 14:14:09 +0100
commitc366c3dbc866f7049e85d9695b92d52ee2a67a7e (patch)
treec94a6993382b6f52d9b67dc2a898344ce3bdda41 /nixos/modules/misc
parent22b07705b2fa8863b2368ed8a07e6d73da619eb7 (diff)
parent5464e0a0182603b13d9d8779bffb417e01b1273f (diff)
downloadnixpkgs-c366c3dbc866f7049e85d9695b92d52ee2a67a7e.tar
nixpkgs-c366c3dbc866f7049e85d9695b92d52ee2a67a7e.tar.gz
nixpkgs-c366c3dbc866f7049e85d9695b92d52ee2a67a7e.tar.bz2
nixpkgs-c366c3dbc866f7049e85d9695b92d52ee2a67a7e.tar.lz
nixpkgs-c366c3dbc866f7049e85d9695b92d52ee2a67a7e.tar.xz
nixpkgs-c366c3dbc866f7049e85d9695b92d52ee2a67a7e.tar.zst
nixpkgs-c366c3dbc866f7049e85d9695b92d52ee2a67a7e.zip
Merge pull request #209064 from Lassulus/os-release-extra
Diffstat (limited to 'nixos/modules/misc')
-rw-r--r--nixos/modules/misc/version.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index 1067b21a22b..c9e06382b7a 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -28,6 +28,8 @@ let
     DOCUMENTATION_URL = "https://nixos.org/learn.html";
     SUPPORT_URL = "https://nixos.org/community.html";
     BUG_REPORT_URL = "https://github.com/NixOS/nixpkgs/issues";
+  } // lib.optionalAttrs (cfg.variant_id != null) {
+    VARIANT_ID = cfg.variant_id;
   };
 
   initrdReleaseContents = osReleaseContents // {
@@ -87,6 +89,13 @@ in
       description = lib.mdDoc "The NixOS release code name (e.g. `Emu`).";
     };
 
+    nixos.variant_id = mkOption {
+      type = types.nullOr (types.strMatching "^[a-z0-9._-]+$");
+      default = null;
+      description = lib.mdDoc "A lower-case string identifying a specific variant or edition of the operating system";
+      example = "installer";
+    };
+
     stateVersion = mkOption {
       type = types.str;
       # TODO Remove this and drop the default of the option so people are forced to set it.