Files
nixpkgs/pkgs/by-name/md/mdbook/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

53 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
nix,
rustPlatform,
installShellFiles,
}:
let
version = "0.4.52";
in
rustPlatform.buildRustPackage rec {
inherit version;
pname = "mdbook";
src = fetchFromGitHub {
owner = "rust-lang";
repo = "mdBook";
tag = "v${version}";
hash = "sha256-a3GSMz1+8Ve5cp4x1NjBlsCU/wMC4Jl3/H9qx7+1XlI=";
};
cargoHash = "sha256-wvTixSVHXglJM+nBMulZNZKF8pZfNd2G8Z+1PlAWmpk=";
nativeBuildInputs = [ installShellFiles ];
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;
};
};
meta = {
description = "Create books from MarkDown";
mainProgram = "mdbook";
homepage = "https://github.com/rust-lang/mdBook";
changelog = "https://github.com/rust-lang/mdBook/blob/v${version}/CHANGELOG.md";
license = [ lib.licenses.mpl20 ];
maintainers = with lib.maintainers; [
havvy
Frostman
matthiasbeyer
];
};
}