summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30 14:15:18 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30 15:21:12 +0100
commitc20403631da45ab4eff6dc803d4701da421ad05a (patch)
tree5e0e9228e44074223d620b70400549641d554e7d /nixos/modules
parent58e9440b8983c2e0dbab667dc7944e8af9955a35 (diff)
downloadnixpkgs-c20403631da45ab4eff6dc803d4701da421ad05a.tar
nixpkgs-c20403631da45ab4eff6dc803d4701da421ad05a.tar.gz
nixpkgs-c20403631da45ab4eff6dc803d4701da421ad05a.tar.bz2
nixpkgs-c20403631da45ab4eff6dc803d4701da421ad05a.tar.lz
nixpkgs-c20403631da45ab4eff6dc803d4701da421ad05a.tar.xz
nixpkgs-c20403631da45ab4eff6dc803d4701da421ad05a.tar.zst
nixpkgs-c20403631da45ab4eff6dc803d4701da421ad05a.zip
Factor out "man" into a separate module and add "man" outputs to system.path
Fixes #10270.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/config/system-path.nix3
-rw-r--r--nixos/modules/module-list.nix3
-rw-r--r--nixos/modules/programs/man.nix30
-rw-r--r--nixos/modules/services/misc/nixos-manual.nix4
4 files changed, 35 insertions, 5 deletions
diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix
index 8701b714eec..f9257f578bf 100644
--- a/nixos/modules/config/system-path.nix
+++ b/nixos/modules/config/system-path.nix
@@ -28,7 +28,6 @@ let
       pkgs.xz
       pkgs.less
       pkgs.libcap
-      pkgs.man
       pkgs.nano
       pkgs.ncurses
       pkgs.netcat
@@ -106,7 +105,6 @@ in
         "/info"
         "/lib" # FIXME: remove
         #"/lib/debug/.build-id" # enables GDB to find separated debug info
-        "/man"
         "/sbin"
         "/share/applications"
         "/share/desktop-directories"
@@ -114,7 +112,6 @@ in
         "/share/emacs"
         "/share/icons"
         "/share/info"
-        "/share/man"
         "/share/menus"
         "/share/mime"
         "/share/nano"
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index d204b31c9e8..3a5fb41dc79 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -61,9 +61,11 @@
   ./programs/command-not-found/command-not-found.nix
   ./programs/dconf.nix
   ./programs/environment.nix
+  ./programs/freetds.nix
   ./programs/ibus.nix
   ./programs/kbdlight.nix
   ./programs/light.nix
+  ./programs/man.nix
   ./programs/nano.nix
   ./programs/screen.nix
   ./programs/shadow.nix
@@ -73,7 +75,6 @@
   ./programs/uim.nix
   ./programs/venus.nix
   ./programs/wvdial.nix
-  ./programs/freetds.nix
   ./programs/xfs_quota.nix
   ./programs/zsh/zsh.nix
   ./rename.nix
diff --git a/nixos/modules/programs/man.nix b/nixos/modules/programs/man.nix
new file mode 100644
index 00000000000..b2850653804
--- /dev/null
+++ b/nixos/modules/programs/man.nix
@@ -0,0 +1,30 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+{
+
+  options = {
+
+    programs.man.enable = mkOption {
+      type = types.bool;
+      default = true;
+      description = ''
+        Whether to enable manual pages and the <command>man</command> command.
+      '';
+    };
+
+  };
+
+
+  config = mkIf config.programs.man.enable {
+
+    environment.systemPackages = [ pkgs.man ];
+
+    environment.pathsToLink = [ "/share/man" ];
+
+    environment.outputsToLink = [ "man" ];
+
+  };
+
+}
diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix
index c10d8197686..7534eb0ae6a 100644
--- a/nixos/modules/services/misc/nixos-manual.nix
+++ b/nixos/modules/services/misc/nixos-manual.nix
@@ -92,7 +92,9 @@ in
 
     system.build.manual = manual;
 
-    environment.systemPackages = [ manual.manpages manual.manual help ];
+    environment.systemPackages =
+      [ manual.manual help ]
+      ++ optional config.programs.man.enable manual.manpages;
 
     boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"];