From fbd4563b537ee083ffdc6964cf027e542a2ff249 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Thu, 5 Apr 2018 22:27:46 +0000 Subject: [PATCH] nixos: documentation: implement `documentation.dev.enable` option I know that "devinfo" output does not currently exist, but so does "devman". It is mentioned in the nixpkgs manual, but no derivation in nixpkgs actually uses it. --- nixos/modules/misc/documentation.nix | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 4af40a6bb42d..2e426c017080 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -50,6 +50,21 @@ let cfg = config.documentation; in ''; }; + dev.enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to install documentation targeted at developers. + + This includes man pages targeted at developers if is + set (this also includes "devman" outputs). + This includes info pages targeted at developers if + is set (this also includes "devinfo" outputs). + This includes other pages targeted at developers if + is set (this also includes "devdoc" outputs). + + ''; + }; }; @@ -60,20 +75,20 @@ let cfg = config.documentation; in (mkIf cfg.man.enable { environment.systemPackages = [ pkgs.man-db ]; environment.pathsToLink = [ "/share/man" ]; - environment.extraOutputsToInstall = [ "man" ]; + environment.extraOutputsToInstall = [ "man" ] ++ optional cfg.dev.enable [ "devman" ]; }) (mkIf cfg.info.enable { environment.systemPackages = [ pkgs.texinfoInteractive ]; environment.pathsToLink = [ "/share/info" ]; - environment.extraOutputsToInstall = [ "info" ]; + environment.extraOutputsToInstall = [ "info" ] ++ optional cfg.dev.enable [ "devinfo" ]; }) (mkIf cfg.doc.enable { # TODO(@oxij): put it here and remove from profiles? # environment.systemPackages = [ pkgs.w3m ]; # w3m-nox? environment.pathsToLink = [ "/share/doc" ]; - environment.extraOutputsToInstall = [ "doc" ]; + environment.extraOutputsToInstall = [ "doc" ] ++ optional cfg.dev.enable [ "devdoc" ]; }) ]);