mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-25 14:46:45 +00:00
57be605ed4
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* lib.neovimConfiguration: deprecated extraModules and configuration * docs: various fixes
43 lines
935 B
Nix
43 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
|
|
];
|
|
}
|