diff --git a/profiles/dn42-router/default.nix b/profiles/dn42-router/default.nix index 463e552..dc353ea 100644 --- a/profiles/dn42-router/default.nix +++ b/profiles/dn42-router/default.nix @@ -11,6 +11,9 @@ let bgp6Table = 2342; in { + imports = [ + ./documentation.nix + ]; options.profiles.clerie.dn42-router = { enable = mkEnableOption "DN42 router base config"; @@ -93,6 +96,10 @@ in { type = types.str; default = ""; }; + htmlDocumentation = mkOption { + type = types.str; + description = "This option is set by the module itself and contains the documentation for this router setup"; + }; }; config = mkIf config.profiles.clerie.dn42-router.enable { diff --git a/profiles/dn42-router/documentation.nix b/profiles/dn42-router/documentation.nix new file mode 100644 index 0000000..b8fea65 --- /dev/null +++ b/profiles/dn42-router/documentation.nix @@ -0,0 +1,88 @@ +{ config, lib, ... }: + +with lib; + +let + + cfg = config.profiles.clerie.dn42-router; + +in { + + profiles.clerie.dn42-router.htmlDocumentation = '' + + + + + +

${config.networking.fqdn}

+ +

This is a router in the experimental decentralized network dn42.

+ +

If you like to peer, please drop me an email to dn42@clerie.de.

+ +

Happy peering!

+ +

Router Information

+ + + +

Wireguard Peers

+ + + ${concatMapStringsSep "\n" (peer: '' + + + + + + + '') cfg.wireguardPeers} +
${peer.peerName}AS${peer.remoteAsn} +
+ Peering config +
    +
  • Local Endpoint: ${config.networking.fqdn}:???
  • +
  • Local Address: ${peer.localAddress}
  • +
  • Local ASN: AS4242422574
  • +
+
    +
  • Remote Endpoint: ???
  • +
  • Remote Address: ${peer.remoteAddress}
  • +
  • Remote ASN: AS${peer.remoteAsn}
  • +
+
+
[Map]
+ +

BGP Peers

+ + + ${concatMapStringsSep "\n" (peer: '' + + + + + + + '') cfg.bgpPeers} +
${peer.peerName}AS${peer.remoteAsn} +
+ Peering config +
    +
  • Local Address: ${peer.localAddress}
  • +
  • Local ASN: AS4242422574
  • +
+
    +
  • Remote Address: ${peer.remoteAddress}
  • +
  • Remote ASN: AS${peer.remoteAsn}
  • +
+
+
[Map]
+ + + ''; + +}