From 03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sat, 1 Jun 2019 17:20:19 +0200 Subject: nixos/documentation: nixos-help: use w3m(1) by default It is referenced in various places, but does not work out of the box: $ nixos-help /run/current-system/sw/bin/nixos-help: unable to start a web browser; please set $BROWSER In the user-hidden fallbacks to xdg-open(1) and w3m(1), `nixos-help` expects tools to be deliberately installed by users. For default installations and new users in general, this is unlikely to be the case. Conversely, chances to use `nixos-help` are even higher in such cases. Use w3m-nographics by default to ensure documentation is always available. The documentation browser on ttyS8 already does so, but is not accessible in every installation, e.g. VMs with only ttyS0 and SSH available. This obsoletes including it in the base profile's systemPackages, so remove the @TODO as done. --- nixos/modules/misc/documentation.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'nixos/modules/misc') diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 834ac0de9121..deecb005270f 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -49,11 +49,7 @@ let if [ -z "$browser" ]; then browser="$(type -P xdg-open || true)" if [ -z "$browser" ]; then - browser="$(type -P w3m || true)" - if [ -z "$browser" ]; then - echo "$0: unable to start a web browser; please set \$BROWSER" - exit 1 - fi + browser="${pkgs.w3m-nographics}/bin/w3m" fi fi exec "$browser" ${manual.manualHTMLIndex} @@ -187,8 +183,6 @@ in }) (mkIf cfg.doc.enable { - # TODO(@oxij): put it here and remove from profiles? - # environment.systemPackages = [ pkgs.w3m ]; # w3m-nox? environment.pathsToLink = [ "/share/doc" ]; environment.extraOutputsToInstall = [ "doc" ] ++ optional cfg.dev.enable "devdoc"; }) -- cgit 1.4.1