diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-10 13:28:20 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-10 13:28:20 +0200 |
commit | 5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010 (patch) | |
tree | a6c0f605be6de3f372ae69905b331f9f75452da7 /nixos/modules/programs/info.nix | |
parent | 6070bc016bd2fd945b04347e25cfd3738622d2ac (diff) | |
download | nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.gz nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.bz2 nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.lz nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.xz nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.zst nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.zip |
Move all of NixOS to nixos/ in preparation of the repository merge
Diffstat (limited to 'nixos/modules/programs/info.nix')
-rw-r--r-- | nixos/modules/programs/info.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/nixos/modules/programs/info.nix b/nixos/modules/programs/info.nix new file mode 100644 index 00000000000..30c25cf3420 --- /dev/null +++ b/nixos/modules/programs/info.nix @@ -0,0 +1,36 @@ +{config, pkgs, ...}: + +let + + # Quick hack to make the `info' command work properly. `info' needs + # a "dir" file containing all the installed Info files, which we + # don't have (it would be impure to have a package installation + # update some global "dir" file). So this wrapper script around + # "info" builds a temporary "dir" file on the fly. This is a bit + # slow (on a cold cache) but not unacceptably so. + infoWrapper = pkgs.writeScriptBin "info" + '' + #! ${pkgs.stdenv.shell} + + dir=$(mktemp --tmpdir -d "info.dir.XXXXXX") + + if test -z "$dir"; then exit 1; fi + + trap 'rm -rf "$dir"' EXIT + + shopt -s nullglob + + for i in $(IFS=:; echo $INFOPATH); do + for j in $i/*.info; do + ${pkgs.texinfo}/bin/install-info --quiet $j $dir/dir + done + done + + INFOPATH=$dir:$INFOPATH ${pkgs.texinfo}/bin/info "$@" + ''; # */ + +in + +{ + environment.systemPackages = [ infoWrapper pkgs.texinfo ]; +} |