]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/databases/openldap/default.nix
Move secrets to flakes
[perso/Immae/Config/Nix.git] / modules / private / databases / openldap / default.nix
index efe93795c79f1901c03ff0c737230e4ff4eb61a4..f4851b5f885a09d3d98ff6994526619b873f2897 100644 (file)
@@ -98,7 +98,14 @@ in
         permissions = "0400";
         user = "openldap";
         group = "openldap";
-        text = builtins.readFile "${cfg.accessFile}";
+        text = builtins.readFile cfg.accessFile;
+      }
+      {
+        dest = "ldap";
+        permissions = "0500";
+        user = "openldap";
+        group = "openldap";
+        isDir = true;
       }
     ];
     users.users.openldap.extraGroups = [ "keys" ];
@@ -107,7 +114,6 @@ in
     security.acme.certs."ldap" = config.myServices.databasesCerts // {
       user = "openldap";
       group = "openldap";
-      plugins = [ "fullchain.pem" "key.pem" "cert.pem" "account_key.json" "account_reg.json" ];
       domain = "ldap.immae.eu";
       postRun = ''
         systemctl restart openldap.service
@@ -116,13 +122,14 @@ in
 
     services.filesWatcher.openldap = {
       restart = true;
-      paths = [ "${config.secrets.location}/ldap/" ];
+      paths = [ config.secrets.fullPaths."ldap" ];
     };
 
     services.openldap = {
       enable = true;
       dataDir = cfg.dataDir;
       urlList = [ "ldap://" "ldaps://" ];
+      logLevel = "none";
       extraConfig = ldapConfig;
       extraDatabaseConfig = ''
         moduleload      memberof
@@ -132,9 +139,9 @@ in
         overlay         syncprov
         syncprov-checkpoint 100 10
 
-        include ${config.secrets.location}/ldap/access
+        include ${config.secrets.fullPaths."ldap/access"}
         '';
-      rootpwFile = "${config.secrets.location}/ldap/password";
+      rootpwFile = config.secrets.fullPaths."ldap/password";
       suffix = cfg.baseDn;
       rootdn = cfg.rootDn;
       database = "hdb";