Merge pull request #19289 from DerTim1/openldap-add-configDir-option

openldap: add configDir option

authored by Jörg Thalheim and committed by GitHub 6f99aa9a f2872c5d

+8 -1
+8 -1
nixos/modules/services/databases/openldap.nix
··· 53 53 description = "The database directory."; 54 54 }; 55 55 56 + configDir = mkOption { 57 + type = types.path; 58 + default = ""; 59 + description = "Use this optional config directory instead of using slapd.conf"; 60 + example = "/var/db/slapd.d"; 61 + }; 62 + 56 63 extraConfig = mkOption { 57 64 type = types.lines; 58 65 default = ""; ··· 96 103 mkdir -p ${cfg.dataDir} 97 104 chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir} 98 105 ''; 99 - serviceConfig.ExecStart = "${openldap.out}/libexec/slapd -u ${cfg.user} -g ${cfg.group} -d 0 -h \"${concatStringsSep " " cfg.urlList}\" -f ${configFile}"; 106 + serviceConfig.ExecStart = "${openldap.out}/libexec/slapd -u ${cfg.user} -g ${cfg.group} -d 0 -h \"${concatStringsSep " " cfg.urlList}\" ${if cfg.configDir == "" then "-f "+configFile else "-F "+cfg.configDir}"; 100 107 }; 101 108 102 109 users.extraUsers.openldap =