diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2023-11-18 23:50:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-18 23:50:58 -0500 |
commit | 227bf4382f49e21ff7147ffb8dafe51db8b59357 (patch) | |
tree | 5f77e6327e45df2b393fea8bab48f4f131989b35 /pkgs/tools/text | |
parent | 1bde115d4fd827e91e8fa486eedd1046b269b6b4 (diff) | |
parent | bfa27b35065f88e5a300829c8bc02926bcc0665f (diff) | |
download | nixlib-227bf4382f49e21ff7147ffb8dafe51db8b59357.tar nixlib-227bf4382f49e21ff7147ffb8dafe51db8b59357.tar.gz nixlib-227bf4382f49e21ff7147ffb8dafe51db8b59357.tar.bz2 nixlib-227bf4382f49e21ff7147ffb8dafe51db8b59357.tar.lz nixlib-227bf4382f49e21ff7147ffb8dafe51db8b59357.tar.xz nixlib-227bf4382f49e21ff7147ffb8dafe51db8b59357.tar.zst nixlib-227bf4382f49e21ff7147ffb8dafe51db8b59357.zip |
Merge pull request #267061 from nix-julia/add-shell-completions-mdbook
mdbook: add shell completions
Diffstat (limited to 'pkgs/tools/text')
-rw-r--r-- | pkgs/tools/text/mdbook/default.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/tools/text/mdbook/default.nix b/pkgs/tools/text/mdbook/default.nix index e0529c77917b..95483b8465ed 100644 --- a/pkgs/tools/text/mdbook/default.nix +++ b/pkgs/tools/text/mdbook/default.nix @@ -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; |