mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
mdbook: add shell completions
This commit is contained in:
parent
9aaf627661
commit
bfa27b3506
@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchFromGitHub, nix, rustPlatform, CoreServices }:
|
||||
{ lib, stdenv, fetchFromGitHub, nix, rustPlatform, CoreServices, installShellFiles }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "mdbook";
|
||||
@ -13,8 +13,17 @@ rustPlatform.buildRustPackage rec {
|
||||
|
||||
cargoHash = "sha256-D0XhrweO0A1+81Je4JZ0lmnbIHstNvefpmogCyB4FEE=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd mdbook \
|
||||
--bash <($out/bin/mdbook completions bash) \
|
||||
--fish <($out/bin/mdbook completions fish) \
|
||||
--zsh <($out/bin/mdbook completions zsh )
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = {
|
||||
inherit nix;
|
||||
|
Loading…
Reference in New Issue
Block a user