anchor.diff:          '';
         };
   
  -      controlPort = mkOption {
  +      openFirewall = mkOption {
  +        type = types.bool;
  +        default = true;
  +        description = ''
  +          Whether to automatically open the specified ports in the firewall.
  +        '';
  +      };
  +
  +      inherit sampleFormat;
  +      inherit codec;
  +
  +      streamBuffer = mkOption {
  +        type = with types; nullOr int;
  +        default = null;
  +        description = ''
  +          Stream read (input) buffer in ms.
  +        '';
  +        example = 20;
  +      };
  +
  +      buffer = mkOption {
  +        type = with types; nullOr int;
  +        default = null;
  +        description = ''
  +          Network buffer in ms.
  +        '';
  +        example = 1000;
  +      };
  +
  +      sendToMuted = mkOption {
  +        type = types.bool;
  +        default = false;
  +        description = ''
  +          Send audio to muted clients.
  +        '';
  +      };
  +
  +      tcp.enable = mkOption {
  +        type = types.bool;
  +        default = true;
  +        description = ''
  +          Whether to enable the JSON-RPC via TCP.
  +        '';
  +      };
  +
  +      tcp.listenAddress = mkOption {
  +        type = types.str;
  +        default = "::";
  +        example = "0.0.0.0";
  +        description = ''
  +          The address where the TCP JSON-RPC listens on.
  +        '';
  +      };
  +
  +      tcp.port = mkOption {
           type = types.port;
           default = 1705;
           description = ''
  -          The port for control connections (JSON-RPC).
  -        '';
  -      };
  -
  -      openFirewall = mkOption {
  +          The port where the TCP JSON-RPC listens on.
  +        '';
  +      };
  +
  +      http.enable = mkOption {
           type = types.bool;
           default = true;
           description = ''
  -          Whether to automatically open the specified ports in the firewall.
  -        '';
  -      };
  -
  -      inherit sampleFormat;
  -      inherit codec;
  +          Whether to enable the JSON-RPC via HTTP.
  +        '';
  +      };
  +
  +      http.listenAddress = mkOption {
  +        type = types.str;
  +        default = "::";
  +        example = "0.0.0.0";
  +        description = ''
  +          The address where the HTTP JSON-RPC listens on.
  +        '';
  +      };
  +
  +      http.port = mkOption {
  +        type = types.port;
  +        default = 1780;
  +        description = ''
  +          The port where the HTTP JSON-RPC listens on.
  +        '';
  +      };
  +
  +      http.docRoot = mkOption {
  +        type = with types; nullOr path;
  +        default = null;
  +        description = ''
  +          Path to serve from the HTTP servers root.
  +        '';
  +      };
   
         streams = mkOption {
           type = with types; attrsOf (submodule {
  
positive.code:         default = false;
          description = ''
            Whether to enable snapserver.
          '';
        };
  
  
negative.code:       };
      };
  
      networking.firewall.allowedTCPPorts =
        optionals cfg.openFirewall [ cfg.port ]
        ++ optional cfg.tcp.enable cfg.tcp.port
        ++ optional cfg.http.enable cfg.http.port;
    };
  
    meta = {
  