configure domain in a central file

This commit is contained in:
eyjhb 2024-08-11 14:50:32 +02:00
parent 865e1251de
commit d459fa895e
Signed by: eyjhb
GPG key ID: 609F508E3239F920
8 changed files with 52 additions and 30 deletions

View file

@ -1,13 +1,15 @@
{ config, ... }:
{
let
svc_domain = "ldap.${config.mine.settings.domain}";
in {
services.lldap = {
enable = true;
settings = {
verbose = true;
ldap_user_email = "fricloudlldap.grief462@simplelogin.com";
ldap_base_dn = "dc=fricloud,dc=dk";
ldap_base_dn = config.mine.settings.ldap.dc;
};
environment = {
@ -20,7 +22,7 @@
};
};
services.nginx.virtualHosts."ldap.fricloud.dk" = {
services.nginx.virtualHosts."${svc_domain}" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:${builtins.toString config.services.lldap.settings.http_port}";
@ -51,7 +53,7 @@
port = 3890;
url = "ldap://${host}:${builtins.toString port}";
dc = "dc=fricloud,dc=dk";
dc = "dc=${config.mine.settings.domain_sld},dc=${config.mine.settings.domain_tld}";
bind_dn = "uid=${users.bind},ou=${ou.users},${dc}";
search_base = "ou=${ou.users},${dc}";
user_filter = "(memberof=cn=${groups.member},ou=${ou.groups},${dc})";
@ -78,6 +80,7 @@
lastname = "sn";
email = "mail";
avatar = "jpegPhoto";
groupname = "cn";
};
age_secret = config.age.secrets.lldap-bind-user-pass.path;