From 3632478b8d91a56711b0434707e0982ec8688d88 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 15 Oct 2017 16:01:41 +0200 Subject: [PATCH] man: add module --- modules/default.nix | 1 + modules/misc/news.nix | 10 ++++++++++ modules/programs/man.nix | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 modules/programs/man.nix diff --git a/modules/default.nix b/modules/default.nix index d43831ee7..1b1d97a6f 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -31,6 +31,7 @@ let ./programs/htop.nix ./programs/info.nix ./programs/lesspipe.nix + ./programs/man.nix ./programs/rofi.nix ./programs/ssh.nix ./programs/termite.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 18c7f9a8f..c7be03c85 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -328,6 +328,16 @@ in will be set only on zsh launch. ''; } + + { + time = "2017-10-15T13:59:47+00:00"; + message = '' + A new module is available: 'programs.man'. + + This module is enabled by default and makes sure that manual + pages are installed for packages in 'home.packages'. + ''; + } ]; }; } diff --git a/modules/programs/man.nix b/modules/programs/man.nix new file mode 100644 index 000000000..702b8932d --- /dev/null +++ b/modules/programs/man.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options = { + programs.man.enable = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable manual pages and the man + command. This also includes "man" outputs of all + home.packages. + ''; + }; + }; + + config = mkIf config.programs.man.enable { + home.packages = [ pkgs.man-db ]; + home.extraOutputsToInstall = [ "man" ]; + }; +}