anchor.diff:      ${if cfg.extraDatabaseConfig != null then cfg.extraDatabaseConfig else ""}
     '');
   
  -  configDir = lib.escapeShellArg (if cfg.configDir != null then cfg.configDir else "/etc/openldap/slapd.d");
  +  configDir = if cfg.configDir != null then cfg.configDir else "/etc/openldap/slapd.d";
   
     ldapValueType = let
       singleLdapValueType = types.either types.str (types.submodule {
  
positive.code:             dataDir = lib.escapeShellArg (getAttr dn dataDirs);
            in ''
              rm -rf ${dataDir}/*
              ${openldap}/bin/slapadd -F ${configDir} -b ${dn} -l ${file}
              chown -R "${cfg.user}:${cfg.group}" ${dataDir}
            '') dataFiles)}
          '')}
  
          ${openldap}/bin/slaptest -u -F ${configDir}
        '';
        serviceConfig = {
          ExecStart = lib.concatStringsSep " " [
            "${openldap}/libexec/slapd"
            "-u '${cfg.user}'"
            "-g '${cfg.group}'"
            "-h '${concatStringsSep " " cfg.urlList}'"
            "-F ${configDir}"
          ];
          Type = "forking";
          PIDFile = cfg.settings.attrs.olcPidFile;
        };
      };
  
      users.users = lib.optionalAttrs (cfg.user == "openldap") {
        openldap = { group = cfg.group; };
      };
  
      users.groups = lib.optionalAttrs (cfg.group == "openldap") {
  
negative.code:       };
  
        logLevel = mkOption {
          type = types.nullOr (types.coercedTo types.str (lib.splitString " ") (types.listOf types.str));
          default = null;
          example = literalExample "[ \"acl\" \"trace\" ]";
          description = "The log level.";
  