anchor.diff:  let
     cfg = config.services.graphite;
     writeTextOrNull = f: t: if t == null then null else pkgs.writeText f t;
  +
     dataDir = "/var/db/graphite";
  +  carbonOpts = name: with config.ids; ''
  +    --nodaemon --syslog --prefix=${name} \
  +    --uid ${toString uids.graphite} --gid ${toString uids.graphite} ${name}
  +  '';
  +  carbonEnv = {
  +    PYTHONPATH = "${pkgs.python27Packages.carbon}/lib/python2.7/site-packages";
  +    GRAPHITE_ROOT = dataDir;
  +    GRAPHITE_CONF_DIR = "/etc/graphite/";
  +  };
  +
   in {
   
     ###### interface
  
positive.code:       description = "Graphite data storage backend";
        wantedBy = [ "multi-user.target" ];
        after = [ "network-interfaces.target" ];
        environment = {
          GRAPHITE_CONF_DIR = "/etc/graphite/";
          GRAPHITE_STORAGE_DIR = "/var/db/graphite/";
        };
        serviceConfig = {
          ExecStart = "${pkgs.pythonPackages.carbon}/bin/carbon-cache.py --pidfile /tmp/carbonCache.pid start";
          User = "graphite";
          Group = "graphite";
        };
        restartTriggers = [
          pkgs.pythonPackages.carbon
          cfg.carbon.config
  
negative.code:       description = "Carbon data aggregator";
        wantedBy = [ "multi-user.target" ];
        after = [ "network-interfaces.target" ];
        environment = carbonEnv;
        serviceConfig.ExecStart = "${pkgs.twisted}/bin/twistd ${carbonOpts "carbon-aggregator"}";
        restartTriggers = [
          pkgs.pythonPackages.carbon cfg.carbon.config cfg.carbon.aggregationRules
        ];
  