about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/profiles/installation-device.nix1
-rw-r--r--nixos/modules/services/misc/nixos-manual.nix47
2 files changed, 25 insertions, 23 deletions
diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix
index 9c84d267a3343..d51ed195580d5 100644
--- a/nixos/modules/profiles/installation-device.nix
+++ b/nixos/modules/profiles/installation-device.nix
@@ -25,6 +25,7 @@ with lib;
     documentation.enable = mkForce true;
 
     # Show the manual.
+    documentation.nixos.enable = mkForce true;
     services.nixosManual.showManual = true;
 
     # Let the user play Rogue on TTY 8 during the installation.
diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix
index 7202269d34217..df3e71c80dea3 100644
--- a/nixos/modules/services/misc/nixos-manual.nix
+++ b/nixos/modules/services/misc/nixos-manual.nix
@@ -44,29 +44,30 @@ in
   };
 
 
-  config = mkIf cfg.showManual {
-
-    assertions = [{
-      assertion = cfgd.enable && cfgd.nixos.enable;
-      message   = "Can't enable `service.nixosManual.showManual` without `documentation.nixos.enable`";
-    }];
-
-    boot.extraTTYs = [ "tty${toString cfg.ttyNumber}" ];
-
-    systemd.services."nixos-manual" = {
-      description = "NixOS Manual";
-      wantedBy = [ "multi-user.target" ];
-      serviceConfig = {
-        ExecStart = "${cfg.browser} ${config.system.build.manual.manualHTMLIndex}";
-        StandardInput = "tty";
-        StandardOutput = "tty";
-        TTYPath = "/dev/tty${toString cfg.ttyNumber}";
-        TTYReset = true;
-        TTYVTDisallocate = true;
-        Restart = "always";
+  config = mkMerge [
+    (mkIf cfg.showManual {
+      assertions = singleton {
+        assertion = cfgd.enable && cfgd.nixos.enable;
+        message   = "Can't enable `services.nixosManual.showManual` without `documentation.nixos.enable`";
       };
-    };
-
-  };
+    })
+    (mkIf (cfg.showManual && cfgd.enable && cfgd.nixos.enable) {
+      boot.extraTTYs = [ "tty${toString cfg.ttyNumber}" ];
+
+      systemd.services."nixos-manual" = {
+        description = "NixOS Manual";
+        wantedBy = [ "multi-user.target" ];
+        serviceConfig = {
+          ExecStart = "${cfg.browser} ${config.system.build.manual.manualHTMLIndex}";
+          StandardInput = "tty";
+          StandardOutput = "tty";
+          TTYPath = "/dev/tty${toString cfg.ttyNumber}";
+          TTYReset = true;
+          TTYVTDisallocate = true;
+          Restart = "always";
+        };
+      };
+    })
+  ];
 
 }