8 CoreServices ? darwin.apple_sdk.frameworks.CoreServices,
14 rustPlatform.buildRustPackage {
18 src = fetchFromGitHub {
21 rev = "refs/tags/v${version}";
22 hash = "sha256-GGQK2Mf3EK1rwBMzQkAzWAaK6Fh0Qqqf8dtDjZPxOMA=";
25 cargoHash = "sha256-jriSQHn+Y+EWtwDJeMTAuCCHR7fEtWsErAxbG9a4pts=";
27 nativeBuildInputs = [ installShellFiles ];
29 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices ];
31 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
32 installShellCompletion --cmd mdbook \
33 --bash <($out/bin/mdbook completions bash) \
34 --fish <($out/bin/mdbook completions fish) \
35 --zsh <($out/bin/mdbook completions zsh )
45 description = "Create books from MarkDown";
46 mainProgram = "mdbook";
47 homepage = "https://github.com/rust-lang/mdBook";
48 changelog = "https://github.com/rust-lang/mdBook/blob/v${version}/CHANGELOG.md";
49 license = [ lib.licenses.mpl20 ];
50 maintainers = with lib.maintainers; [