{ config, lib, pkgs, ... }:

let cfg = config.sydnix.documentation;
in {
  options.sydnix.documentation = {
    enable = lib.mkEnableOption "man and info pages" // {
      default = true;
    };
  };

  config = lib.mkIf cfg.enable {
    documentation = {
      man.enable = true;
      info.enable = true;
    };

    environment.systemPackages = with pkgs; [
      man-pages
      stdman
      man-pages-posix
      stdmanpages
    ];
  };
}
