diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix
index 3645b8b..a8ab81d 100644
--- a/nix/pkgs/default.nix
+++ b/nix/pkgs/default.nix
@@ -103,10 +103,14 @@ let
vlan-report = import ./vlan-report.nix {
inherit self nixpkgs system;
};
+
+ homepage = pkgs.callPackage ./homepage {
+ inherit self;
+ };
in
rootfs-packages // vm-packages // device-templates // openwrt-packages // network-graphs // network-cypher-graphs // starlink // subnetplans // {
inherit export-openwrt-models export-config dns-slaves
encrypt-secrets decrypt-secrets switch-to-production
- vlan-report
+ homepage vlan-report
;
}
diff --git a/nix/pkgs/homepage/default.nix b/nix/pkgs/homepage/default.nix
new file mode 100644
index 000000000..906a424
--- /dev/null
+++ b/nix/pkgs/homepage/default.nix
@@ -0,0 +1,52 @@
+{ self
+, system
+, substituteAll
+, stdenv
+, pandoc
+}:
+
+let
+
+ inherit (self.packages.${system}) network-graphs subnetplans vlan-report;
+
+in
+stdenv.mkDerivation {
+ pname = "zentralwerk-network-homepage";
+ version = self.lastModifiedDate;
+
+ src = ./src;
+
+ nativeBuildInputs = [
+ pandoc
+ ];
+ buildPhase = ''
+ pandoc -t html ${../../../doc/hello.md} > index.html
+ pandoc -t html ${vlan-report} > vlan-report.html
+ ln -s ${substituteAll {
+ src = ./figure.html;
+ img = "physical.png";
+ caption = "Physikalische Netzwerkstruktur";
+ }} physical.html
+ ln -s ${substituteAll {
+ src = ./figure.html;
+ img = "logical.png";
+ caption = "Logische Netzwerkstruktur";
+ }} logical.html
+
+ ln -s ${subnetplans}/share/doc/zentralwerk/* .
+ for F in *.html; do
+ cat ${./header.html} "$F" ${./footer.html} > "$F.new"
+ rm "$F"
+ mv "$F.new" "$F"
+ done
+ '';
+
+ installPhase = ''
+ DIR=$out/share/doc/zentralwerk/www
+ mkdir -p $DIR
+
+ ln -s ${network-graphs}/share/doc/zentralwerk/* $DIR/
+ ln -s ${../../../doc/core.png} $DIR/core.png
+ cp *.{html,css,png,svg} $DIR/
+ '';
+}
diff --git a/nix/pkgs/homepage/figure.html b/nix/pkgs/homepage/figure.html
new file mode 100644
index 000000000..5e490c2
--- /dev/null
+++ b/nix/pkgs/homepage/figure.html
@@ -0,0 +1,4 @@
+
diff --git a/nix/pkgs/homepage/footer.html b/nix/pkgs/homepage/footer.html
new file mode 100644
index 000000000..bccce69
--- /dev/null
+++ b/nix/pkgs/homepage/footer.html
@@ -0,0 +1,14 @@
+
+
+
+
+