anchor.diff:          ";
         };
   
  +      package = mkOption {
  +        type = types.package;
  +        default = pkgs.openldap;
  +        description = ''
  +          OpenLDAP package to use.
  +
  +          This can be used to, for example, set an OpenLDAP package
  +          with custom overrides to enable modules or other
  +          functionality.
  +        '';
  +      };
  +
         user = mkOption {
           type = types.str;
           default = "openldap";
  
positive.code:         ";
          example = literalExample ''
              '''
              include ${pkgs.openldap.out}/etc/schema/core.schema
              include ${pkgs.openldap.out}/etc/schema/cosine.schema
              include ${pkgs.openldap.out}/etc/schema/inetorgperson.schema
              include ${pkgs.openldap.out}/etc/schema/nis.schema
  
              database bdb
              suffix dc=example,dc=org
  
negative.code: let
  
    cfg = config.services.openldap;
    openldap = cfg.package;
  
    dataFile = pkgs.writeText "ldap-contents.ldif" cfg.declarativeContents;
    configFile = pkgs.writeText "slapd.conf" ((optionalString cfg.defaultSchemas ''
      include ${openldap.out}/etc/schema/core.schema
      include ${openldap.out}/etc/schema/cosine.schema
      include ${openldap.out}/etc/schema/inetorgperson.schema
      include ${openldap.out}/etc/schema/nis.schema
    '') + ''
      ${cfg.extraConfig}
      database ${cfg.database}
  