network-graphs: use graphviz without X

This commit is contained in:
Sandro - 2023-05-26 22:28:37 +02:00
parent 53692344ee
commit 29ceeb88a4
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,5 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
inherit (pkgs) lib runCommand graphviz;
netColor = net:
if net == "core"
then "grey"
@ -82,13 +80,13 @@ let
}
'';
renderGraph = args@{ name, engine, ... }:
runCommand "${name}.png" {
pkgs.runCommand "${name}.png" {
src = builtins.toFile "${name}.dot" (
toDot args
);
} ''
echo $src
${graphviz}/bin/${engine} -Tpng $src > $out
${pkgs.graphviz-nox}/bin/${engine} -Tpng $src > $out
'';
in rec {
@ -162,7 +160,7 @@ in rec {
) (builtins.attrNames containers);
};
network-graphs = runCommand "network-graphs" {} ''
network-graphs = pkgs.runCommand "network-graphs" {} ''
DIR=$out/share/doc/zentralwerk
mkdir -p $DIR
ln -s ${physical-graph} $DIR/physical.png