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.
This commit is contained in:
pennae 2021-12-18 19:37:41 +01:00
parent 1301bdb185
commit 50954ad1c5
4 changed files with 43 additions and 8 deletions

View file

@ -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;