From a3e5ba58fd1d83cd91f43cc9a81ba28a91bd2aae Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Tue, 12 Oct 2021 12:37:04 -0700 Subject: [PATCH] mdbook-graphviz: init at 0.1.2 (#141395) Co-authored-by: Sandro --- pkgs/tools/text/mdbook-graphviz/default.nix | 26 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/tools/text/mdbook-graphviz/default.nix diff --git a/pkgs/tools/text/mdbook-graphviz/default.nix b/pkgs/tools/text/mdbook-graphviz/default.nix new file mode 100644 index 000000000000..d8412605dcbe --- /dev/null +++ b/pkgs/tools/text/mdbook-graphviz/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices, graphviz }: + +rustPlatform.buildRustPackage rec { + pname = "mdbook-graphviz"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "dylanowen"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-wIgWaCjJrrajvUZbJjpx9P4urN2/eVo3+Za2NjTKWvM="; + }; + + cargoSha256 = "sha256-F8JuEk0ztB7jfcPNjU9vGsr3HLEJ2DmWGWxvdbLuyvQ="; + + buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ]; + + checkInputs = [ graphviz ]; + + meta = with lib; { + description = "A preprocessor for mdbook, rendering Graphviz graphs to HTML at build time."; + homepage = "https://github.com/dylanowen/mdbook-graphviz"; + license = [ licenses.mpl20 ]; + maintainers = with maintainers; [ lovesegfault ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 08af4679ce20..2387a9747b2e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6825,6 +6825,10 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) CoreServices; }; + mdbook-graphviz = callPackage ../tools/text/mdbook-graphviz { + inherit (darwin.apple_sdk.frameworks) CoreServices; + }; + mdbook-katex = callPackage ../tools/text/mdbook-katex { inherit (darwin.apple_sdk.frameworks) CoreServices; };