nixos/manual: nixos-help knows about colon-separated BROWSER

This is the semantics as understood by `xdg-open`. Using these semantics
on a non-colon-separated variable works because it acts as if it was a
one element long list.

This fixes an issue where it would try to exec
`google-chrome-beta:google-chrome:chromium:firefox` on a system
configured with these semantics in mind.

+7 -1
+7 -1
nixos/modules/services/misc/nixos-manual.nix
··· 44 44 helpScript = pkgs.writeScriptBin "nixos-help" 45 45 '' 46 46 #! ${pkgs.runtimeShell} -e 47 - browser="$BROWSER" 47 + # Finds first executable browser in a colon-separated list. 48 + # (see how xdg-open defines BROWSER) 49 + browser="$( 50 + IFS=: ; for b in $BROWSER; do 51 + [ -n "$(type -P "$b" || true)" ] && echo "$b" && break 52 + done 53 + )" 48 54 if [ -z "$browser" ]; then 49 55 browser="$(type -P xdg-open || true)" 50 56 if [ -z "$browser" ]; then