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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user