1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-26 08:39:50 +01:00
neovim-flake/docs/html-open-tool.nix
Gerg-L 57be605ed4
lib.neovimConfiguration: deprecated extraModules and configuration ()
* lib.neovimConfiguration: deprecated extraModules and configuration

* docs: various fixes
2024-09-22 22:52:10 +03:00

42 lines
935 B
Nix

{
writeShellScriptBin,
makeDesktopItem,
symlinkJoin,
html,
}: let
helpScript = writeShellScriptBin "nvf-help" ''
set -euo pipefail
if [[ ! -v BROWSER || -z $BROWSER ]]; then
for candidate in xdg-open open w3m; do
BROWSER="$(type -P $candidate || true)"
if [[ -x $BROWSER ]]; then
break;
fi
done
fi
if [[ ! -v BROWSER || -z $BROWSER ]]; then
echo "$0: unable to start a web browser; please set \$BROWSER"
exit 1
else
exec "$BROWSER" "${html}/share/doc/nvf/index.xhtml"
fi
'';
desktopItem = makeDesktopItem {
name = "nvf-manual";
desktopName = "nvf Manual";
genericName = "View nvf documentation in a web browser";
icon = "nix-snowflake";
exec = "${helpScript}/bin/nvf-help";
categories = ["System"];
};
in
symlinkJoin {
name = "nvf-help";
paths = [
helpScript
desktopItem
];
}