From 14aa201b658f43546b00153bb2ada7206ba8dd26 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 7 Apr 2022 23:36:35 +0200 Subject: [PATCH] lib.modules: Allow making _module.args internal This allows other module system consumers to disable these docs via option merging. For instance arion uses asciidoc instead of docbook so that would look awful. --- lib/modules.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/modules.nix b/lib/modules.nix index abcdd1a894cc..b2f6c7376330 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -156,7 +156,10 @@ rec { type = types.lazyAttrsOf types.raw; # Only render documentation once at the root of the option tree, # not for all individual submodules. - internal = prefix != []; + # Allow merging option decls to make this internal regardless. + ${if prefix == [] + then null # unset => visible + else "internal"} = true; # TODO: Change the type of this option to a submodule with a # freeformType, so that individual arguments can be documented # separately