2022-08-12 12:06:08 +00:00
|
|
|
{ nixosLib, pkgsModule, runCommand }:
|
|
|
|
|
|
|
|
let
|
|
|
|
sys = nixosLib.evalModules rec {
|
|
|
|
modules = [
|
|
|
|
pkgsModule
|
|
|
|
../documentation.nix
|
|
|
|
../version.nix
|
|
|
|
|
|
|
|
({ lib, someArg, ... }: {
|
|
|
|
# Make sure imports from specialArgs are respected
|
|
|
|
imports = [ someArg.myModule ];
|
|
|
|
|
|
|
|
# TODO test this
|
|
|
|
meta.doc = ./test-dummy.chapter.xml;
|
|
|
|
})
|
|
|
|
|
|
|
|
{
|
|
|
|
_module.args = {
|
|
|
|
baseModules = [
|
|
|
|
../documentation.nix
|
|
|
|
../version.nix
|
|
|
|
];
|
|
|
|
extraModules = [ ];
|
|
|
|
inherit modules;
|
|
|
|
};
|
|
|
|
documentation.nixos.includeAllModules = true;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
specialArgs.someArg.myModule = { lib, ... }: {
|
|
|
|
options.foobar = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2022-09-09 14:08:57 +00:00
|
|
|
description = lib.mdDoc "The foobar option was added via specialArgs";
|
2022-08-12 12:06:08 +00:00
|
|
|
default = "qux";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
runCommand "documentation-check"
|
|
|
|
{
|
|
|
|
inherit (sys.config.system.build.manual) optionsJSON;
|
|
|
|
} ''
|
|
|
|
json="$optionsJSON/share/doc/nixos/options.json"
|
|
|
|
echo checking $json
|
|
|
|
|
|
|
|
grep 'The foobar option was added via specialArgs' <"$json" >/dev/null
|
|
|
|
touch $out
|
|
|
|
''
|