summary refs log tree commit diff
path: root/nixos/modules/misc
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2019-06-01 17:20:19 +0200
committerJan Tojnar <jtojnar@gmail.com>2019-06-09 17:11:20 +0200
commit03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4 (patch)
tree133b6828951240b2b977473999e963b28ec5179a /nixos/modules/misc
parent168d1031af4916354491a1b1dd103258cfd26c0e (diff)
downloadnixpkgs-03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4.tar
nixpkgs-03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4.tar.gz
nixpkgs-03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4.tar.bz2
nixpkgs-03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4.tar.lz
nixpkgs-03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4.tar.xz
nixpkgs-03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4.tar.zst
nixpkgs-03d6c406fc6ac48a04cb6d290eca7ea7136cbdc4.zip
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.
Diffstat (limited to 'nixos/modules/misc')
-rw-r--r--nixos/modules/misc/documentation.nix8
1 files changed, 1 insertions, 7 deletions
diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix
index 834ac0de912..deecb005270 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";
     })