11 rustPlatform.buildRustPackage rec {
12 pname = "termbook-cli";
15 src = fetchFromGitHub {
19 sha256 = "Bo3DI0cMXIfP7ZVr8MAW/Tmv+4mEJBIQyLvRfVBDG8c=";
23 lockFile = ./Cargo.lock;
33 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
34 darwin.apple_sdk.frameworks.Security
38 RUSTONIG_SYSTEM_LIBONIG = true;
41 # update dependencies to fix build failure caused by unaligned packed structs
43 ln -sf ${./Cargo.lock} Cargo.lock
46 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
47 installShellCompletion --cmd termbook \
48 --bash <($out/bin/termbook completions bash) \
49 --fish <($out/bin/termbook completions fish) \
50 --zsh <($out/bin/termbook completions zsh)
54 description = "Runner for `mdbooks` to keep your documentation tested";
55 mainProgram = "termbook";
56 homepage = "https://github.com/Byron/termbook/";
57 changelog = "https://github.com/Byron/termbook/blob/${src.rev}/CHANGELOG.md";
58 license = licenses.asl20;
59 maintainers = with maintainers; [ phaer ];