2017-05-21 10:51:01 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.info;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
programs.info.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
2024-04-14 23:02:32 +02:00
|
|
|
description = "Whether to enable info pages and the {command}`info` command.";
|
2017-05-21 10:51:01 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.texinfoInteractive ];
|
|
|
|
|
|
|
|
environment.pathsToLink = [ "/info" "/share/info" ];
|
|
|
|
environment.extraOutputsToInstall = [ "info" ];
|
|
|
|
|
2024-08-03 14:57:36 +03:00
|
|
|
environment.extraSetup = ''
|
2017-05-21 10:51:01 +02:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|