Merge pull request #91963 from tazjin/feat/openldap-package
nixos/openldap: add option for configuring OpenLDAP package to use
This commit is contained in:
commit
e226b1287b
@ -5,14 +5,14 @@ with lib;
|
|||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.services.openldap;
|
cfg = config.services.openldap;
|
||||||
openldap = pkgs.openldap;
|
openldap = cfg.package;
|
||||||
|
|
||||||
dataFile = pkgs.writeText "ldap-contents.ldif" cfg.declarativeContents;
|
dataFile = pkgs.writeText "ldap-contents.ldif" cfg.declarativeContents;
|
||||||
configFile = pkgs.writeText "slapd.conf" ((optionalString cfg.defaultSchemas ''
|
configFile = pkgs.writeText "slapd.conf" ((optionalString cfg.defaultSchemas ''
|
||||||
include ${pkgs.openldap.out}/etc/schema/core.schema
|
include ${openldap.out}/etc/schema/core.schema
|
||||||
include ${pkgs.openldap.out}/etc/schema/cosine.schema
|
include ${openldap.out}/etc/schema/cosine.schema
|
||||||
include ${pkgs.openldap.out}/etc/schema/inetorgperson.schema
|
include ${openldap.out}/etc/schema/inetorgperson.schema
|
||||||
include ${pkgs.openldap.out}/etc/schema/nis.schema
|
include ${openldap.out}/etc/schema/nis.schema
|
||||||
'') + ''
|
'') + ''
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
database ${cfg.database}
|
database ${cfg.database}
|
||||||
@ -46,6 +46,18 @@ in
|
|||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 {
|
user = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "openldap";
|
default = "openldap";
|
||||||
@ -152,10 +164,10 @@ in
|
|||||||
";
|
";
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
'''
|
'''
|
||||||
include ${pkgs.openldap.out}/etc/schema/core.schema
|
include ${openldap.out}/etc/schema/core.schema
|
||||||
include ${pkgs.openldap.out}/etc/schema/cosine.schema
|
include ${openldap.out}/etc/schema/cosine.schema
|
||||||
include ${pkgs.openldap.out}/etc/schema/inetorgperson.schema
|
include ${openldap.out}/etc/schema/inetorgperson.schema
|
||||||
include ${pkgs.openldap.out}/etc/schema/nis.schema
|
include ${openldap.out}/etc/schema/nis.schema
|
||||||
|
|
||||||
database bdb
|
database bdb
|
||||||
suffix dc=example,dc=org
|
suffix dc=example,dc=org
|
||||||
|
Loading…
x
Reference in New Issue
Block a user