]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/ether/default.nix
Add specification for the private config file as a module.
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / ether / default.nix
index 62a169197caa07796e57ec55d8e36629e28e8f3f..1c56ed7a2fc6ed77f18c6e5a145b12ce425dfda7 100644 (file)
@@ -1,6 +1,6 @@
-{ lib, pkgs, config, myconfig,  ... }:
+{ lib, pkgs, config,  ... }:
 let
-  env = myconfig.env.tools.etherpad-lite;
+  env = config.myEnv.tools.etherpad-lite;
   cfg = config.myServices.websites.tools.etherpad-lite;
   # Make sure we’re not rebuilding whole libreoffice just because of a
   # dependency
@@ -89,15 +89,15 @@ in {
               "ldapauth": {
                 "url": "ldaps://${env.ldap.host}",
                 "accountBase": "${env.ldap.base}",
-                "accountPattern": "(&(memberOf=cn=users,cn=etherpad,ou=services,dc=immae,dc=eu)(uid={{username}}))",
+                "accountPattern": "${env.ldap.filter}",
                 "displayNameAttribute": "cn",
-                "searchDN": "cn=etherpad,ou=services,dc=immae,dc=eu",
+                "searchDN": "${env.ldap.dn}",
                 "searchPWD": "${env.ldap.password}",
                 "groupSearchBase": "${env.ldap.base}",
                 "groupAttribute": "member",
                 "groupAttributeIsDN": true,
                 "searchScope": "sub",
-                "groupSearch": "(memberOf=cn=groups,cn=etherpad,ou=services,dc=immae,dc=eu)",
+                "groupSearch": "${env.ldap.group_filter}",
                 "anonymousReadonly": false
               }
             },
@@ -155,7 +155,7 @@ in {
 
         RewriteEngine On
 
-        RewriteMap  redirects "txt:${pkgs.writeText "redirects.txt" myconfig.env.tools.etherpad-lite.redirects}"
+        RewriteMap  redirects "txt:${pkgs.writeText "redirects.txt" config.myEnv.tools.etherpad-lite.redirects}"
         RewriteCond %{QUERY_STRING}         "!noredirect"
         RewriteCond %{REQUEST_URI}          "^(.*)$"
         RewriteCond ''${redirects:$1|Unknown} "!Unknown"