aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorKai Wohlfahrt <kai.wohlfahrt@gmail.com>2020-08-16 20:17:06 +0100
committerKai Wohlfahrt <kai.wohlfahrt@gmail.com>2020-11-21 15:39:19 +0000
commit057cb570beb9226b610dffa00cffd98b007a0686 (patch)
tree74eead9911ccaaa8b537705f131e7ade033b6028 /nixos
parent1fde3c35619bd445357077d816c72b0e589e0775 (diff)
nixos/openldap: Add delcarativeConfig by suffix
Adding by index could be an issue if the user wanted the data to be added to a DB other than the first.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/databases/openldap.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/databases/openldap.nix b/nixos/modules/services/databases/openldap.nix
index afe24597e03f..d03c8cd7cfd3 100644
--- a/nixos/modules/services/databases/openldap.nix
+++ b/nixos/modules/services/databases/openldap.nix
@@ -474,14 +474,14 @@ in {
${openldap}/bin/slaptest -f ${configFile} -F ${configDir} || true
'' else ''
rm -Rf '${configDir}'/*
- ${openldap}/bin/slapadd -F ${configDir} -n0 -l ${settingsFile}
+ ${openldap}/bin/slapadd -F ${configDir} -bcn=config -l ${settingsFile}
''
)}
chown -R "${cfg.user}:${cfg.group}" '${configDir}'
${optionalString (cfg.declarativeContents != null) ''
rm -Rf '${lib.head dataDirs}'/*
- ${openldap}/bin/slapadd -F ${configDir} -n1 -l ${dataFile}
+ ${openldap}/bin/slapadd -F ${configDir} -b${cfg.suffix} -l ${dataFile}
chown -R "${cfg.user}:${cfg.group}" ${lib.escapeShellArgs dataDirs}
''}