nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 curl,
7 openssl,
8 versionCheckHook,
9 nix-update-script,
10}:
11
12rustPlatform.buildRustPackage (finalAttrs: {
13 pname = "mdbook-plugins";
14 version = "0.3.4";
15
16 src = fetchFromGitHub {
17 owner = "RustForWeb";
18 repo = "mdbook-plugins";
19 rev = "v${finalAttrs.version}";
20 hash = "sha256-28Olgft2IQvvJEQ9oqj5o96MT8rILUESQiTOtpc2xLw=";
21 };
22
23 cargoHash = "sha256-5Mok7E85DKmo0NIdUZJhinLCWKk+G0tIBKcTy71kUxk=";
24
25 nativeBuildInputs = [
26 pkg-config
27 rustPlatform.bindgenHook
28 ];
29
30 buildInputs = [
31 curl
32 openssl
33 ];
34
35 env.OPENSSL_NO_VENDOR = true;
36
37 cargoBuildFlags = [
38 "--bin=mdbook-tabs"
39 "--bin=mdbook-trunk"
40 ];
41
42 doInstallCheck = true;
43 nativeInstallCheckInputs = [
44 versionCheckHook
45 ];
46
47 passthru.updateScript = nix-update-script { };
48
49 meta = {
50 description = "Plugins for mdBook";
51 homepage = "https://mdbook-plugins.rustforweb.org/";
52 changelog = "https://github.com/RustForWeb/mdbook-plugins/releases/tag/v${finalAttrs.version}";
53 license = lib.licenses.mit;
54 maintainers = with lib.maintainers; [ redianthus ];
55 mainProgram = "mdbook-tabs";
56 };
57})