anchor.diff:      "${wrappedPlugins}/libexec/netdata/plugins.d"
     ] ++ cfg.extraPluginPaths;
   
  +  configDirectory = pkgs.runCommand "netdata-config-d" { } ''
  +    mkdir $out
  +    ${concatStringsSep "\n" (mapAttrsToList (path: file: ''
  +        mkdir -p "$out/$(dirname ${path})"
  +        ln -s "${file}" "$out/${path}"
  +      '') cfg.configDir)}
  +  '';
  +
     localConfig = {
       global = {
  +      "config directory" = configDirectory;
         "plugins directory" = concatStringsSep " " plugins;
       };
       web = {
  
positive.code:       description = "Real time performance monitoring";
        after = [ "network.target" ];
        wantedBy = [ "multi-user.target" ];
        path = (with pkgs; [ curl gawk iproute2 which ])
          ++ lib.optional cfg.python.enable (pkgs.python3.withPackages cfg.python.extraPackages)
          ++ lib.optional config.virtualisation.libvirtd.enable (config.virtualisation.libvirtd.package);
        environment = {
  
negative.code:         '';
        };
  
        configDir = mkOption {
          type = types.attrsOf types.path;
          default = {};
          description = ''
            Complete netdata config directory except netdata.conf.
            The default configuration is merged with changes
            defined in this option.
            Each top-level attribute denotes a path in the configuration
            directory as in environment.etc.
            Its value is the absolute path and must be readable by netdata.
            Cannot be combined with configText.
          '';
          example = literalExpression ''
            "health_alarm_notify.conf" = pkgs.writeText "health_alarm_notify.conf" '''
              sendmail="/path/to/sendmail"
            ''';
            "health.d" = "/run/secrets/netdata/health.d";
          '';
        };
  
        enableAnalyticsReporting = mkOption {
          type = types.bool;
          default = false;
  