wrapper-manager-fds/modules/env: add options to add documentation packages

This commit is contained in:
Gabriel Arazas 2024-07-31 16:51:25 +08:00
parent 9626b2c952
commit 3aa48b27ca
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 24 additions and 3 deletions

View File

@ -119,5 +119,14 @@ in
yourMomName = "Joe Mama";
};
};
# They're all disabled by default to let wrapper-manager not get out of the
# way. wrapper-manager configurations are meant to be a part of other
# environments and we're trying not to make a spotlight for wrapper-manager
# in whatever form including exporting the documentation.
documentation = {
manpage.enable = lib.mkEnableOption "manpage output";
html.enable = lib.mkEnableOption "HTML output";
};
};
}

View File

@ -1,7 +1,8 @@
{ config, lib, ... }@moduleArgs:
{ config, lib, pkgs, ... }@moduleArgs:
let
cfg = config.wrapper-manager;
wmDocs = import ../../../docs { inherit pkgs; };
in
{
imports = [
@ -9,7 +10,13 @@ in
];
config = lib.mkMerge [
{ wrapper-manager.extraSpecialArgs.hmConfig = config; }
{
home.packages =
lib.optionals cfg.documentation.manpage.enable [ wmDocs.outputs.manpage ]
++ lib.optionals cfg.documentation.html.enable [ wmDocs.outputs.html ];
wrapper-manager.extraSpecialArgs.hmConfig = config;
}
(lib.mkIf (moduleArgs ? nixosConfig) {
wrapper-manager.sharedModules = [

View File

@ -1,7 +1,8 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.wrapper-manager;
wmDocs = import ../../../docs { inherit pkgs; };
in
{
imports = [
@ -10,6 +11,10 @@ in
config = lib.mkMerge [
{
environment.systemPackages =
lib.optionals cfg.documentation.manpage.enable [ wmDocs.outputs.manpage ]
++ lib.optionals cfg.documentation.html.enable [ wmDocs.outputs.html ];
wrapper-manager.extraSpecialArgs.nixosConfig = config;
wrapper-manager.sharedModules = [