anchor.diff:        type = path;
       };
   
  +    pidFile = mkOption {
  +      default = "/var/run/collectd.pid";
  +      description = ''
  +        Location of collectd pid file.
  +      '';
  +      type = path;
  +    };
  +
       autoLoadPlugin = mkOption {
         default = false;
         description = ''
  
positive.code: 
    conf = pkgs.writeText "collectd.conf" ''
      BaseDir "${cfg.dataDir}"
      PIDFile "${cfg.dataDir}/collectd.pid"
      AutoLoadPlugin ${if cfg.autoLoadPlugin then "true" else "false"}
      Hostname ${config.networking.hostName}
  
  
negative.code:       wantedBy = [ "multi-user.target" ];
  
        serviceConfig = {
          ExecStart = "${pkgs.collectd}/sbin/collectd -C ${conf} -P ${cfg.pidFile}";
          Type = "forking";
          PIDFile = cfg.pidFile;
          User = optional (cfg.user!="root") cfg.user;
          PermissionsStartOnly = true;
        };
  
        preStart = ''
          mkdir -m 0700 -p ${cfg.dataDir}
          install -D /dev/null ${cfg.pidFile}
          if [ "$(id -u)" = 0 ]; then
            chown -R ${cfg.user} ${cfg.dataDir};
            chown ${cfg.user} ${cfg.pidFile}
          fi
        '';
      }; 
  
  