nixpkgs/pkgs/by-name/md/mdbook/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.3 KiB
Nix
Raw Normal View History

2024-07-13 07:56:42 +00:00
{
lib,
stdenv,
fetchFromGitHub,
nix,
rustPlatform,
darwin,
CoreServices ? darwin.apple_sdk.frameworks.CoreServices,
installShellFiles,
}:
let
version = "0.4.40";
2024-07-13 07:56:42 +00:00
in
rustPlatform.buildRustPackage {
inherit version;
pname = "mdbook";
src = fetchFromGitHub {
2021-08-08 07:03:03 +00:00
owner = "rust-lang";
repo = "mdBook";
2022-12-15 17:29:45 +00:00
rev = "refs/tags/v${version}";
hash = "sha256-GGQK2Mf3EK1rwBMzQkAzWAaK6Fh0Qqqf8dtDjZPxOMA=";
};
cargoHash = "sha256-jriSQHn+Y+EWtwDJeMTAuCCHR7fEtWsErAxbG9a4pts=";
2023-11-12 14:54:43 +00:00
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices ];
2023-11-12 14:54:43 +00:00
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 )
'';
2022-07-16 00:45:46 +00:00
passthru = {
tests = {
inherit nix;
};
};
meta = {
description = "Create books from MarkDown";
mainProgram = "mdbook";
2021-08-08 07:03:03 +00:00
homepage = "https://github.com/rust-lang/mdBook";
2022-12-15 17:29:45 +00:00
changelog = "https://github.com/rust-lang/mdBook/blob/v${version}/CHANGELOG.md";
license = [ lib.licenses.mpl20 ];
2024-07-13 07:56:42 +00:00
maintainers = with lib.maintainers; [
havvy
Frostman
matthiasbeyer
];
};
}