nix-config/modules/documentation.nix

41 lines
916 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2021-04-17 13:40:28 +02:00
let
cfg = config.my.module.documentation;
in
{
options.my.module.documentation = with lib.my; {
enable = mkDisableOption "Documentation integration";
dev.enable = mkDisableOption "Documentation aimed at developers";
2021-04-17 13:40:28 +02:00
info.enable = mkDisableOption "Documentation aimed at developers";
2021-04-17 13:40:28 +02:00
man = {
enable = mkDisableOption "Documentation aimed at developers";
linux = mkDisableOption "Linux man pages (section 2 & 3)";
};
2021-04-17 13:40:28 +02:00
nixos.enable = mkDisableOption "NixOS documentation";
2021-04-17 13:40:28 +02:00
};
config = lib.mkIf cfg.enable {
documentation = {
enable = true;
2021-04-17 13:40:28 +02:00
dev.enable = cfg.dev.enable;
2021-04-17 13:40:28 +02:00
info.enable = cfg.info.enable;
2021-04-17 13:40:28 +02:00
man = {
enable = cfg.man.enable;
generateCaches = true;
};
nixos.enable = cfg.nixos.enable;
2021-04-17 13:40:28 +02:00
};
environment.systemPackages = lib.optional cfg.man.linux pkgs.manpages;
2021-04-17 13:40:28 +02:00
};
}