From 14518675e90fbcc701e0824db54dd0b003e699ed Mon Sep 17 00:00:00 2001 From: xrelkd <46590321+xrelkd@users.noreply.github.com> Date: Wed, 14 Apr 2021 10:52:08 +0800 Subject: [PATCH] mdbook-mermaid: init at 0.8.1 --- pkgs/tools/text/mdbook-mermaid/default.nix | 24 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/tools/text/mdbook-mermaid/default.nix diff --git a/pkgs/tools/text/mdbook-mermaid/default.nix b/pkgs/tools/text/mdbook-mermaid/default.nix new file mode 100644 index 000000000000..b29fbbd6e0d6 --- /dev/null +++ b/pkgs/tools/text/mdbook-mermaid/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices }: + +rustPlatform.buildRustPackage rec { + pname = "mdbook-mermaid"; + version = "0.8.1"; + + src = fetchFromGitHub { + owner = "badboy"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-UMYWRQeSQwWVJla/+RPlAXPMuFVnxqDtYDxLKmbMw4g="; + }; + + cargoSha256 = "sha256-nhJS2QZUyGeNRMS9D+P+QPMDHK2PqVK/H2AKaP7EECw="; + + buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ]; + + meta = with lib; { + description = "A preprocessor for mdbook to add mermaid.js support"; + homepage = "https://github.com/badboy/mdbook-mermaid"; + license = [ licenses.mpl20 ]; + maintainers = with maintainers; [ xrelkd ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 10a4c799ebef..c438e63ebdd6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6034,6 +6034,10 @@ in inherit (darwin.apple_sdk.frameworks) CoreServices; }; + mdbook-mermaid = callPackage ../tools/text/mdbook-mermaid { + inherit (darwin.apple_sdk.frameworks) CoreServices; + }; + mdcat = callPackage ../tools/text/mdcat { inherit (darwin.apple_sdk.frameworks) Security; inherit (python3Packages) ansi2html;