anchor.diff:  
   let
     cfg = config.services.graphite;
  -  writeTextOrNull = f: t: if t == null then null else pkgs.writeText f t;
  -
  -  dataDir = "/var/db/graphite";
  +  writeTextOrNull = f: t: if t == null then null else pkgs.writeTextDir f t;
  +
  +  dataDir = cfg.dataDir;
  +
  +  configDir = pkgs.buildEnv {
  +    name = "graphite-config";
  +    paths = lists.filter (el: el != null) [
  +      (writeTextOrNull "carbon.conf" cfg.carbon.config)
  +      (writeTextOrNull "storage-agregation.conf" cfg.carbon.storageAggregation)
  +      (writeTextOrNull "storage-schemas.conf" cfg.carbon.storageSchemas)
  +      (writeTextOrNull "blacklist.conf" cfg.carbon.blacklist)
  +      (writeTextOrNull "whitelist.conf" cfg.carbon.whitelist)
  +      (writeTextOrNull "rewrite-rules.conf" cfg.carbon.rewriteRules)
  +      (writeTextOrNull "relay-rules.conf" cfg.carbon.relayRules)
  +      (writeTextOrNull "aggregation-rules.conf" cfg.carbon.aggregationRules)
  +    ];
  +  };
  +
     carbonOpts = name: with config.ids; ''
  -    --nodaemon --syslog --prefix=${name} --pidfile /var/run/${name}.pid \
  -    --uid ${toString uids.graphite} --gid ${toString uids.graphite} ${name}
  +    --nodaemon --syslog --prefix=${name} --pidfile ${dataDir}/${name}.pid ${name}
     '';
     carbonEnv = {
       PYTHONPATH = "${pkgs.python27Packages.carbon}/lib/python2.7/site-packages";
       GRAPHITE_ROOT = dataDir;
  -    GRAPHITE_CONF_DIR = "/etc/graphite/";
  +    GRAPHITE_CONF_DIR = configDir;
       GRAPHITE_STORAGE_DIR = dataDir;
     };
   
  
positive.code: 
        port = mkOption {
          description = "Graphite web frontend port";
          default = "8080";
          type = types.str;
        };
      };
  
  
negative.code:   ###### implementation
  
    config = mkIf (cfg.carbon.enableAggregator || cfg.carbon.enableCache || cfg.carbon.enableRelay || cfg.web.enable) {
      systemd.services.carbonCache = {
        enable = cfg.carbon.enableCache;
        description = "Graphite Data Storage Backend";
        wantedBy = [ "multi-user.target" ];
        after = [ "network-interfaces.target" ];
        environment = carbonEnv;
        serviceConfig = {
          ExecStart = "${pkgs.twisted}/bin/twistd ${carbonOpts "carbon-cache"}";
          User = "graphite";
          Group = "graphite";
        };
        restartTriggers = [
          pkgs.pythonPackages.carbon
          cfg.carbon.config
  