modules: add documentation
This commit is contained in:
parent
6bf6d21392
commit
e51ab70d5b
|
@ -3,6 +3,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./documentation.nix
|
||||
./ergodox.nix
|
||||
./language.nix
|
||||
./media.nix
|
||||
|
|
37
modules/documentation.nix
Normal file
37
modules/documentation.nix
Normal 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;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue