1 { pkgs, lib, config, ... }:
2 let inherit (builtins) baseNameOf readFile;
4 inherit (pkgs.lib) unlinesAttrs;
5 inherit (config) networking;
6 inherit (config.services) openldap;
7 inherit (config.users) ldap;
8 domainSuffix = "dc=" + lib.concatStringsSep ",dc=" (lib.splitString "." networking.domain);
12 openldap/sourcephile.nix
18 base = "ou=posix,${domainSuffix}";
20 #distinguishedName = "cn=admin,${domainSuffix}";
26 # NOTE: nslcd cannot use SASL to bind to rootpwmoddn
27 # which is the DN used by nslcd when passwd is run by root
28 # to change the userPassword of an LDAP user.
29 # SEE: https://www.reddit.com/r/linuxadmin/comments/53sxpl/how_do_i_configure_nslcd_to_use_a_sasl_external/d7w9awd/
30 # Thus, use: ldappasswd -H ldapi:// -Y EXTERNAL uid=$SomeUID,ou=accounts,ou=posix,dc=sourcephile,dc=fr
39 dataDir = "/var/db/ldap";
40 configDir = "/var/db/slapd";
41 urlList = [ "ldapi:///" ]; # UNIX socket