nix-config/modules/system/documentation.nix

44 lines
960 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2021-04-17 13:40:28 +02:00
let
2021-05-29 16:53:44 +02:00
cfg = config.my.system.documentation;
2021-04-17 13:40:28 +02:00
in
{
2021-05-29 16:53:44 +02:00
options.my.system.documentation = with lib.my; {
2021-04-17 13:40:28 +02:00
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 = with pkgs; lib.optionals cfg.man.linux [
man-pages
man-pages-posix
];
2021-04-17 13:40:28 +02:00
};
}