wrapper-manager-fds/modules: add option for additional modules inclusion in documentation

This commit is contained in:
Gabriel Arazas 2024-09-04 14:49:00 +08:00
parent d28a4c305d
commit d7ea56adf3
4 changed files with 20 additions and 4 deletions

View File

@ -3,6 +3,7 @@ let
in
{
pkgs ? import sources.nixos-unstable { },
extraModules ? [ ],
}:
let
@ -62,7 +63,7 @@ let
wrapperManagerLib = (import ../. { }).lib;
wmOptionsDoc = evalDoc {
modules = [ ../modules/wrapper-manager ];
modules = [ ../modules/wrapper-manager ] ++ extraModules;
includeModuleSystemOptions = true;
};

View File

@ -135,6 +135,20 @@ in
documentation = {
manpage.enable = lib.mkEnableOption "manpage output";
html.enable = lib.mkEnableOption "HTML output";
extraModules = lib.mkOption {
type = with lib.types; listOf deferredModule;
description = ''
List of extra wrapper-manager modules to be included as part of the
documentation.
'';
default = [ ];
example = lib.literalExpression ''
[
./modules/wrapper-manager
]
'';
};
};
};
}

View File

@ -7,7 +7,7 @@
let
cfg = config.wrapper-manager;
wmDocs = import ../../../docs { inherit pkgs; };
wmDocs = import ../../../docs { inherit pkgs; inherit (cfg.documentation) extraModules; };
in
{
imports = [ ../common.nix ];

View File

@ -7,7 +7,7 @@
let
cfg = config.wrapper-manager;
wmDocs = import ../../../docs { inherit pkgs; };
wmDocs = import ../../../docs { inherit pkgs; inherit (cfg.documentation) extraModules; };
in
{
imports = [ ../common.nix ];
@ -33,7 +33,8 @@ in
}
(lib.mkIf (cfg.packages != { }) {
environment.systemPackages = lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages;
environment.systemPackages =
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages;
})
];
}