summaryrefslogtreecommitdiff
path: root/modules/programs/info
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-05-21 10:51:01 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-05-21 10:51:01 +0200
commitd5596d5df2fa66f4c1ccdc62b405e14173f22e6f (patch)
tree252be169cda052db79e337eeb7384686305ca0b5 /modules/programs/info
parentcee2bb93cc35f1c42d2ac54a96b19e3eebc34f82 (diff)
programs-info: add module and run install-info on system packages.
Fixes #25
Diffstat (limited to 'modules/programs/info')
-rw-r--r--modules/programs/info/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/programs/info/default.nix b/modules/programs/info/default.nix
new file mode 100644
index 0000000..de4baa4
--- /dev/null
+++ b/modules/programs/info/default.nix
@@ -0,0 +1,35 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+ cfg = config.programs.info;
+in
+
+{
+ options = {
+ programs.info.enable = mkOption {
+ type = types.bool;
+ default = true;
+ description = "Whether to enable info pages and the <command>info</command> command.";
+ };
+ };
+
+ config = mkIf cfg.enable {
+
+ environment.systemPackages = [ pkgs.texinfoInteractive ];
+
+ environment.pathsToLink = [ "/info" "/share/info" ];
+ environment.extraOutputsToInstall = [ "info" ];
+
+ environment.postBuild = ''
+ if test -w $out/share/info; then
+ shopt -s nullglob
+ for i in $out/share/info/*.info $out/share/info/*.info.gz; do
+ ${pkgs.texinfoInteractive}/bin/install-info $i $out/share/info/dir
+ done
+ fi
+ '';
+
+ };
+}