Commit 6a4caae7 authored by figsoda's avatar figsoda
Browse files

termbook: install shell completions

parent 9d8d1301
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
{ 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/";