nix-config/modules/system/documentation/default.nix

44 lines
975 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
{
2023-03-16 17:39:13 +01:00
options.my.system.documentation = with lib; {
enable = my.mkDisableOption "Documentation integration";
2021-04-17 13:40:28 +02:00
2023-03-16 17:39:13 +01:00
dev.enable = my.mkDisableOption "Documentation aimed at developers";
2021-04-17 13:40:28 +02:00
2023-03-16 17:39:13 +01:00
info.enable = my.mkDisableOption "Documentation aimed at developers";
2021-04-17 13:40:28 +02:00
man = {
2023-03-16 17:39:13 +01:00
enable = my.mkDisableOption "Documentation aimed at developers";
2023-03-16 17:39:13 +01:00
linux = my.mkDisableOption "Linux man pages (section 2 & 3)";
};
2021-04-17 13:40:28 +02:00
2023-03-16 17:39:13 +01:00
nixos.enable = my.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
};
}