programs-info: add module and run install-info on system packages.

Fixes #25
This commit is contained in:
Daiderd Jordan 2017-05-21 10:51:01 +02:00
parent cee2bb93cc
commit d5596d5df2
No known key found for this signature in database
GPG key ID: D02435D05B810C96
3 changed files with 43 additions and 2 deletions

View file

@ -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
'';
};
}