about summary refs log tree commit diff
path: root/pkgs/tools/misc/plantuml
diff options
context:
space:
mode:
authorJacek Galowicz <jacek@galowicz.de>2022-09-26 19:39:38 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2022-10-01 13:15:47 +0200
commit2d66f08d28439ef9c1ca3970557b36cf416da90a (patch)
tree93eb5d9481b2cbab5f67500135d199c82c7cdfee /pkgs/tools/misc/plantuml
parentcec24ab1c8b51b3ae975ea4ed40fab35e2de072b (diff)
plantuml-c4: Add sprites library
Diffstat (limited to 'pkgs/tools/misc/plantuml')
-rw-r--r--pkgs/tools/misc/plantuml/plantuml-c4.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/tools/misc/plantuml/plantuml-c4.nix b/pkgs/tools/misc/plantuml/plantuml-c4.nix
index 94cd76e9370d9..a8d0001054fd8 100644
--- a/pkgs/tools/misc/plantuml/plantuml-c4.nix
+++ b/pkgs/tools/misc/plantuml/plantuml-c4.nix
@@ -16,12 +16,17 @@ let
     sha256 = "sha256-vk4YWdGb47OsI9mApGTQ7OfELRZdBouzKfUZq3kchcM=";
   };
 
+  sprites = fetchzip {
+    url = "https://github.com/tupadr3/plantuml-icon-font-sprites/archive/fa3f885dbd45c9cd0cdf6c0e5e4fb51ec8b76582.zip";
+    sha256 = "sha256-lt9+NNMIaZSkKNsGyHoqXUCTlKmZFGfNYYGjer6X0Xc=";
+  };
+
   # In order to pre-fix the plantuml.jar parameter with the argument
   # -Dplantuml.include.path=..., we post-fix the java command using a wrapper.
   # This way the plantuml derivation can remain unchanged.
   plantumlWithExtraPath =
     let
-      plantumlIncludePath = lib.concatStringsSep ":" [ c4-lib ];
+      plantumlIncludePath = lib.concatStringsSep ":" [ c4-lib sprites ];
       includeFlag = "-Dplantuml.include.path=${lib.escapeShellArg plantumlIncludePath}";
       postFixedJre =
         runCommand "jre-postfixed" { nativeBuildInputs = [ makeWrapper ]; } ''
@@ -53,10 +58,13 @@ stdenv.mkDerivation rec {
     runCommand "c4-plantuml-sample.png" { nativeBuildInputs = [ plantuml-c4 ]; } ''
       sed 's/https:.*\///' "${c4-lib}/samples/C4_Context Diagram Sample - enterprise.puml" > sample.puml
       plantuml sample.puml -o $out
+
+      sed 's/!include ..\//!include /' ${sprites}/examples/complex-example.puml > sprites.puml
+      plantuml sprites.puml -o $out
     '';
 
   meta = with lib; {
-    description = "PlantUML bundled with C4-Plantuml library";
+    description = "PlantUML bundled with C4-Plantuml and plantuml sprites library";
     homepage = "https://github.com/plantuml-stdlib/C4-PlantUML";
     license = licenses.mit;
     maintainers = with maintainers; [ tfc ];