anchor.diff:        preStart = ''
           mkdir -p /var/run/slapd
           chown -R "${cfg.user}:${cfg.group}" /var/run/slapd
  +        ${optionalString (cfg.declarativeContents != null) ''
  +          rm -Rf "${cfg.dataDir}"
  +        ''}
           mkdir -p "${cfg.dataDir}"
  +        ${optionalString (cfg.declarativeContents != null) ''
  +          ${openldap.out}/bin/slapadd ${configOpts} -l ${dataFile}
  +        ''}
           chown -R "${cfg.user}:${cfg.group}" "${cfg.dataDir}"
         '';
         serviceConfig.ExecStart =
  
positive.code:             '''
            '';
        };
      };
  
    };
  
negative.code:   cfg = config.services.openldap;
    openldap = pkgs.openldap;
  
    dataFile = pkgs.writeText "ldap-contents.ldif" cfg.declarativeContents;
    configFile = pkgs.writeText "slapd.conf" cfg.extraConfig;
    configOpts = if cfg.configDir == null then "-f ${configFile}"
                 else "-F ${cfg.configDir}";
  