anchor.diff:        ServerTransportPlugin obfs2,obfs3 exec ${pkgs.pythonPackages.obfsproxy}/bin/obfsproxy managed
       ''}
     ''
  +  + hiddenServices
     + cfg.extraConfig;
  +
  +  hiddenServices = concatStrings (mapAttrsToList (hiddenServiceDir: hs:
  +    let
  +      hsports = concatStringsSep "\n" (map mkHiddenServicePort hs.hiddenServicePorts);
  +    in
  +      "HiddenServiceDir ${hiddenServiceDir}\n${hsports}\n${hs.extraConfig}\n"
  +    ) cfg.hiddenServices);
  +
  +    mkHiddenServicePort = hsport: let
  +      trgt = optionalString (hsport.target != null) (" " + hsport.target);
  +    in "HiddenServicePort ${toString hsport.virtualPort}${trgt}";
   
     torRcFile = pkgs.writeText "torrc" torRc;
   in
  
positive.code:           type    = types.str;
            example = "143";
            description = ''
              What port to advertise for Tor connections. This corresponds
              to the <literal>ORPort</literal> section in the Tor manual; see
              <literal>man tor</literal> for more details.
  
              At a minimum, you should just specify the port for the
              relay to listen on; a common one like 143, 22, 80, or 443
  
negative.code:           default = null;
            example = "month 1 1:00";
            description = ''
              Specify length of an accounting period. This allows you to limit
              overall tor bandwidth over some time period. See the
              <literal>AccountingStart</literal> option by looking at the tor
              manual <citerefentry><refentrytitle>tor</refentrytitle>
              <manvolnum>1</manvolnum></citerefentry> for more.
            '';
          };
  
  