summary refs log tree commit diff
path: root/nixos/modules/misc/version.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/misc/version.nix')
-rw-r--r--nixos/modules/misc/version.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index bdc3e5623be..b3cdaf5568d 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -38,12 +38,19 @@ let
 in
 {
   imports = [
+    ./label.nix
     (mkRenamedOptionModule [ "system" "nixosVersion" ] [ "system" "nixos" "version" ])
     (mkRenamedOptionModule [ "system" "nixosVersionSuffix" ] [ "system" "nixos" "versionSuffix" ])
     (mkRenamedOptionModule [ "system" "nixosRevision" ] [ "system" "nixos" "revision" ])
     (mkRenamedOptionModule [ "system" "nixosLabel" ] [ "system" "nixos" "label" ])
   ];
 
+  options.boot.initrd.osRelease = mkOption {
+    internal = true;
+    readOnly = true;
+    default = initrdRelease;
+  };
+
   options.system = {
 
     nixos.version = mkOption {
@@ -142,11 +149,6 @@ in
       "os-release".text = attrsToText osReleaseContents;
     };
 
-    boot.initrd.systemd.contents = {
-      "/etc/os-release".source = initrdRelease;
-      "/etc/initrd-release".source = initrdRelease;
-    };
-
     # We have to use `warnings` because when warning in the default of the option
     # the warning would also be shown when building the manual since the manual
     # has to evaluate the default.