anchor.diff:          '';
         };
       };
  +
  +    seyren = {
  +      enable = mkOption {
  +        description = "Whether to enable seyren service.";
  +        default = false;
  +        type = types.uniq types.bool;
  +      };
  +
  +      port = mkOption {
  +        description = "Seyren listening port.";
  +        default = 8081;
  +        type = types.int;
  +      };
  +
  +      seyrenUrl = mkOption {
  +        default = "http://localhost:${toString cfg.seyren.port}/";
  +        description = "Host where seyren is accessible.";
  +        type = types.str;
  +      };
  +
  +      graphiteUrl = mkOption {
  +        default = "http://${cfg.web.host}:${toString cfg.web.port}";
  +        description = "Host where graphite service runs.";
  +        type = types.str;
  +      };
  +
  +      mongoUrl = mkOption {
  +        default = "mongodb://${config.services.mongodb.bind_ip}:27017/seyren";
  +        description = "Mongodb connection string.";
  +        type = types.str;
  +      };
  +
  +      extraConfig = mkOption {
  +        default = {};
  +        description = ''
  +          Extra seyren configuration. See
  +          <link xlink:href='https://github.com/scobal/seyren#config' />
  +        '';
  +        type = types.attrsOf types.str;
  +        example = literalExample ''
  +          {
  +            GRAPHITE_USERNAME = "user";
  +            GRAPHITE_PASSWORD = "pass"; 
  +          }
  +        '';
  +      };
  +    };
     };
   
     ###### implementation
   
  -  config = mkIf (cfg.carbon.enableAggregator || cfg.carbon.enableCache || cfg.carbon.enableRelay || cfg.web.enable || cfg.api.enable) {
  +  config = mkIf (
  +    cfg.carbon.enableAggregator ||
  +    cfg.carbon.enableCache ||
  +    cfg.carbon.enableRelay ||
  +    cfg.web.enable ||
  +    cfg.api.enable ||
  +    cfg.seyren.enable
  +  ) {
       systemd.services.carbonCache = {
         enable = cfg.carbon.enableCache;
         description = "Graphite Data Storage Backend";
  
positive.code:       '';
      };
  
      environment.systemPackages = [
        pkgs.pythonPackages.carbon
        pkgs.python27Packages.graphite_web
  
negative.code:     ${concatMapStringsSep "\n" (f: "  - " + f) cfg.api.functions}
      ${cfg.api.extraConfig}
    '';
  
    seyrenConfig = {
      SEYREN_URL = cfg.seyren.seyrenUrl;
      MONGO_URL = cfg.seyren.mongoUrl;
      GRAPHITE_URL = cfg.seyren.graphiteUrl;
    } // cfg.seyren.extraConfig;
  
    configDir = pkgs.buildEnv {
      name = "graphite-config";
  