modules: add documentation

This commit is contained in:
Bruno BELANYI 2021-04-17 11:40:28 +00:00
parent 6bf6d21392
commit e51ab70d5b
2 changed files with 38 additions and 0 deletions

View file

@ -3,6 +3,7 @@
{
imports = [
./documentation.nix
./ergodox.nix
./language.nix
./media.nix

37
modules/documentation.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, lib, ... }:
let
cfg = config.my.module.documentation;
# I usually want everything enabled at once, but keep it customizable
defaultToGlobal = description: lib.mkEnableOption description // {
default = cfg.enable;
};
in
{
options.my.module.documentation = with lib.my; {
enable = mkDisableOption "Documentation integration";
dev.enable = defaultToGlobal "Documentation aimed at developers";
info.enable = defaultToGlobal "Documentation aimed at developers";
man.enable = defaultToGlobal "Documentation aimed at developers";
nixos.enable = defaultToGlobal "NixOS documentation";
};
config.documentation = {
enable = cfg.enable;
dev.enable = cfg.dev.enable;
info.enable = cfg.info.enable;
man = {
enable = cfg.man.enable;
generateCaches = true;
};
nixos.enable = cfg.nixos.enable;
};
}