anchor.diff:    keys = ${tun.keys}
     address = ${tun.address}
     port = ${toString tun.port}
  +  inbound.length = ${toString tun.inbound.length}
  +  outbound.length = ${toString tun.outbound.length}
  +  inbound.quantity = ${toString tun.inbound.quantity}
  +  outbound.quantity = ${toString tun.outbound.quantity}
  +  crypto.tagsToSend = ${toString tun.crypto.tagsToSend}
     '')
     }
     ${flip concatMapStrings
  -    (collect (tun: tun ? port && tun ? host) cfg.outTunnels)
  +    (collect (tun: tun ? port && tun ? host) cfg.inTunnels)
       (tun: let portStr = toString tun.port; in ''
     [${tun.name}]
     type = server
  
positive.code: 
    toOneZero = b: if b then "1" else "0";
  
    i2pdConf = pkgs.writeText "i2pd.conf" ''
        v6 = ${toOneZero cfg.enableIPv6}
        unreachable = ${toOneZero cfg.unreachable}
        floodfill = ${toOneZero cfg.floodfill}
        ${if isNull cfg.port then "" else "port = ${toString cfg.port}"}
        httpproxyport = ${toString cfg.proxy.httpPort}
        socksproxyport = ${toString cfg.proxy.socksPort}
        ircaddress = ${cfg.irc.host}
        ircport = ${toString cfg.irc.port}
        ircdest = ${cfg.irc.dest}
        irckeys = ${cfg.irc.keyFile}
        eepport = ${toString cfg.eep.port}
        ${if isNull cfg.sam.port then "" else "--samport=${toString cfg.sam.port}"}
        eephost = ${cfg.eep.host}
        eepkeys = ${cfg.eep.keyFile}
    '';
  
    i2pdTunnelConf = pkgs.writeText "i2pd-tunnels.conf" ''
  
negative.code:   i2pdSh = pkgs.writeScriptBin "i2pd" ''
      #!/bin/sh
      ${if isNull cfg.extIp then extip else ""}
      ${pkgs.i2pd}/bin/i2pd --log=1 \
        --host=${if isNull cfg.extIp then "$EXTIP" else cfg.extIp} \
        --conf=${i2pdConf} \
        --tunconf=${i2pdTunnelConf}
    '';
  
  in
  