From ddffa1f247346fa19b2c556edc01ab93ccc648e1 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 7 May 2021 17:12:48 +0200 Subject: [PATCH] modules: documentation: add linux man pages option I want to be able to read about syscalls or the C library. --- modules/documentation.nix | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/modules/documentation.nix b/modules/documentation.nix index 093c4cd..8948778 100644 --- a/modules/documentation.nix +++ b/modules/documentation.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.my.module.documentation; in @@ -10,23 +10,31 @@ in 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"; }; - config.documentation = { - enable = cfg.enable; + config = lib.mkIf 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 = { - enable = cfg.man.enable; - generateCaches = true; + man = { + enable = cfg.man.enable; + generateCaches = true; + }; + + nixos.enable = cfg.nixos.enable; }; - nixos.enable = cfg.nixos.enable; + environment.systemPackages = lib.optional cfg.man.linux pkgs.manpages; }; }