diff --git a/docs/default.nix b/docs/default.nix index f66da68..55d16fe 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -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; }; diff --git a/modules/env/common.nix b/modules/env/common.nix index 71bfd91..b4c4111 100644 --- a/modules/env/common.nix +++ b/modules/env/common.nix @@ -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 + ] + ''; + }; }; }; } diff --git a/modules/env/home-manager/default.nix b/modules/env/home-manager/default.nix index ab821f8..daa409f 100644 --- a/modules/env/home-manager/default.nix +++ b/modules/env/home-manager/default.nix @@ -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 ]; diff --git a/modules/env/nixos/default.nix b/modules/env/nixos/default.nix index e6090c5..cb618d2 100644 --- a/modules/env/nixos/default.nix +++ b/modules/env/nixos/default.nix @@ -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; }) ]; }