modules: documentation: add linux man pages option

I want to be able to read about syscalls or the C library.
This commit is contained in:
Bruno BELANYI 2021-05-07 17:12:48 +02:00
parent 2b6399606a
commit ddffa1f247

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.my.module.documentation; cfg = config.my.module.documentation;
in in
@ -10,23 +10,31 @@ in
info.enable = mkDisableOption "Documentation aimed at developers"; info.enable = mkDisableOption "Documentation aimed at developers";
man.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"; nixos.enable = mkDisableOption "NixOS documentation";
}; };
config.documentation = { config = lib.mkIf cfg.enable {
enable = cfg.enable; documentation = {
enable = true;
dev.enable = cfg.dev.enable; dev.enable = cfg.dev.enable;
info.enable = cfg.info.enable; info.enable = cfg.info.enable;
man = { man = {
enable = cfg.man.enable; enable = cfg.man.enable;
generateCaches = true; generateCaches = true;
};
nixos.enable = cfg.nixos.enable;
}; };
nixos.enable = cfg.nixos.enable; environment.systemPackages = lib.optional cfg.man.linux pkgs.manpages;
}; };
} }