From fea03379d635800ca9e96f36467f80d5d5189357 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 18 Oct 2014 09:30:31 +0000 Subject: [PATCH 1/2] nixos: add /share/doc and /share/nano (for symmetry) to environment.pathsToLink and sort all of them --- nixos/modules/config/system-path.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index d7979593f40..ec112b63b2f 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -105,12 +105,14 @@ in "/lib" "/man" "/sbin" + "/share/doc" "/share/emacs" - "/share/vim-plugins" - "/share/org" "/share/info" - "/share/terminfo" "/share/man" + "/share/nano" + "/share/org" + "/share/terminfo" + "/share/vim-plugins" ]; system.path = pkgs.buildEnv { From c6256c0e3e4292080b8574a483bdfce4b7d81b5f Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Mon, 17 Aug 2015 16:04:16 +0000 Subject: [PATCH 2/2] nixos: generate infodirs directly in system-path `man 1 info` says: The first non-option argument, if present, is the menu entry to start from; it is searched for in all `dir' files along INFOPATH. If it is not present, info merges all `dir' files and shows the result. Any remaining arguments are treated as the names of menu items relative to the initial node visited. Which means that this does what previous programs/info did and #8519 (on-the-fly infodir generation for Emacs) wanted to do, but for both programs. --- nixos/modules/config/system-path.nix | 8 ++++++ nixos/modules/module-list.nix | 1 - nixos/modules/programs/info.nix | 38 ---------------------------- 3 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 nixos/modules/programs/info.nix diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index ec112b63b2f..3a9a09ee87c 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -45,6 +45,7 @@ let pkgs.strace pkgs.su pkgs.time + pkgs.texinfoInteractive pkgs.utillinux extraManpages ]; @@ -138,6 +139,13 @@ in if [ -x $out/bin/update-desktop-database -a -w $out/share/applications ]; then $out/bin/update-desktop-database $out/share/applications fi + + if [ -x $out/bin/install-info -a -w $out/share/info ]; then + shopt -s nullglob + for i in $out/share/info/*.info $out/share/info/*.info.gz; do + $out/bin/install-info $i $out/share/info/dir + done + fi ''; }; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 733f3c5d853..6586b36968a 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -61,7 +61,6 @@ ./programs/command-not-found/command-not-found.nix ./programs/dconf.nix ./programs/environment.nix - ./programs/info.nix ./programs/ibus.nix ./programs/kbdlight.nix ./programs/light.nix diff --git a/nixos/modules/programs/info.nix b/nixos/modules/programs/info.nix deleted file mode 100644 index 253f9e87769..00000000000 --- a/nixos/modules/programs/info.nix +++ /dev/null @@ -1,38 +0,0 @@ -{config, pkgs, ...}: - -let - - texinfo = pkgs.texinfoInteractive; - - # 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 - ${texinfo}/bin/install-info --quiet $j $dir/dir - done - done - - INFOPATH=$dir:$INFOPATH ${texinfo}/bin/info "$@" - ''; # */ - -in - -{ - environment.systemPackages = [ infoWrapper texinfo ]; -}