nix-config/modules/documentation.nix
Bruno BELANYI ddffa1f247 modules: documentation: add linux man pages option
I want to be able to read about syscalls or the C library.
2021-05-10 00:31:01 +02:00

41 lines
916 B
Nix

{ config, lib, pkgs, ... }:
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";
info.enable = mkDisableOption "Documentation aimed at developers";
man = {
enable = mkDisableOption "Documentation aimed at developers";
linux = mkDisableOption "Linux man pages (section 2 & 3)";
};
nixos.enable = mkDisableOption "NixOS documentation";
};
config = lib.mkIf cfg.enable {
documentation = {
enable = true;
dev.enable = cfg.dev.enable;
info.enable = cfg.info.enable;
man = {
enable = cfg.man.enable;
generateCaches = true;
};
nixos.enable = cfg.nixos.enable;
};
environment.systemPackages = lib.optional cfg.man.linux pkgs.manpages;
};
}