about summary refs log tree commit diff
path: root/nixos/modules/misc/documentation.nix
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2021-12-18 19:37:41 +0100
committerpennae <github@quasiparticle.net>2022-01-02 19:46:13 +0100
commit50954ad1c5847e04fe78fa155fed97ee52dcb9f6 (patch)
treec69cc5c22c72b1475c566d796b666200f06b30e3 /nixos/modules/misc/documentation.nix
parent1301bdb185c4d0d7c30d0400d76eae8669b5b64d (diff)
nixos/make-options-doc: treat missing descriptions as errors by default
this partially solves the problem of "missing description" warnings of the
options doc build being lost by nix build, at the cost of failing builds that
previously ran. an option to disable this behaviour is provided.
Diffstat (limited to 'nixos/modules/misc/documentation.nix')
-rw-r--r--nixos/modules/misc/documentation.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix
index f868e4b709a68..4451f3026f857 100644
--- a/nixos/modules/misc/documentation.nix
+++ b/nixos/modules/misc/documentation.nix
@@ -15,7 +15,7 @@ let
       f = import m;
       instance = f (mapAttrs (n: _: abort "evaluating ${n} for `meta` failed") (functionArgs f));
     in
-      cfg.nixos.splitOptionDocBuild
+      cfg.nixos.options.splitBuild
         && builtins.isPath m
         && isFunction f
         && instance ? options
@@ -101,6 +101,7 @@ let
               exit 1
             } >&2
         '';
+    inherit (cfg.nixos.options) warningsAreErrors;
   };
 
 
@@ -256,7 +257,7 @@ in
         '';
       };
 
-      nixos.splitOptionDocBuild = mkOption {
+      nixos.options.splitBuild = mkOption {
         type = types.bool;
         default = true;
         description = ''
@@ -266,6 +267,15 @@ in
         '';
       };
 
+      nixos.options.warningsAreErrors = mkOption {
+        type = types.bool;
+        default = true;
+        description = ''
+          Treat warning emitted during the option documentation build (eg for missing option
+          descriptions) as errors.
+        '';
+      };
+
       nixos.includeAllModules = mkOption {
         type = types.bool;
         default = false;