anchor.diff:    cfg = config.services.bosun;
   
     configFile = pkgs.writeText "bosun.conf" ''
  -    tsdbHost = ${cfg.opentsdbHost}
  +    ${optionalString (cfg.opentsdbHost !=null) "tsdbHost = ${cfg.opentsdbHost}"}
  +    ${optionalString (cfg.influxHost !=null) "influxHost = ${cfg.influxHost}"}
       httpListen = ${cfg.listenAddress}
       stateFile = ${cfg.stateFile}
  +    ledisDir = ${cfg.ledisDir}
       checkFrequency = ${cfg.checkFrequency}
   
       ${cfg.extraConfig}
  
positive.code:   };
  
    config = mkIf cfg.enable {
    
      systemd.services.bosun = {
        description = "bosun metrics collector (part of Bosun)";
        wantedBy = [ "multi-user.target" ];
  
negative.code:       };
  
        opentsdbHost = mkOption {
          type = types.nullOr types.string;
          default = "localhost:4242";
          description = ''
            Host and port of the OpenTSDB database that stores bosun data.
            To disable opentsdb you can pass null as parameter.
          '';
        };
  
        influxHost = mkOption {
          type = types.nullOr types.string;
          default = null;
          example = "localhost:8086";
          description = ''
             Host and port of the influxdb database.
          '';
        };
  
  