termbook: install shell completions

This commit is contained in:
figsoda
2023-05-14 17:32:19 -04:00
parent 9d8d1301ba
commit 6a4caae7eb
+9
View File
@@ -1,6 +1,7 @@
{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, pkg-config
, oniguruma
, stdenv
@@ -23,6 +24,7 @@ rustPlatform.buildRustPackage rec {
};
nativeBuildInputs = [
installShellFiles
pkg-config
];
@@ -41,6 +43,13 @@ rustPlatform.buildRustPackage rec {
ln -sf ${./Cargo.lock} Cargo.lock
'';
postInstall = ''
installShellCompletion --cmd termbook \
--bash <($out/bin/termbook completions bash) \
--fish <($out/bin/termbook completions fish) \
--zsh <($out/bin/termbook completions zsh)
'';
meta = with lib; {
description = "A runner for `mdbooks` to keep your documentation tested";
homepage = "https://github.com/Byron/termbook/";