hedgedoc: add

This commit is contained in:
Sandro - 2023-06-05 19:53:21 +02:00
parent 81927acfec
commit 1024d82a53
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 28 additions and 0 deletions

28
modules/hedgedoc.nix Normal file
View File

@ -0,0 +1,28 @@
{ config, lib, ... }:
let
cfg = config.services.hedgedoc;
inherit (config.security) ldap;
in
{
options = {
services.hedgedoc.ldap = {
enable = lib.mkEnableOption (lib.mdDoc ''
login only via LDAP.
Use `service.hedgedoc.environmentFile` in format `bindCredentials=password` to set the credentials used by the search user
'');
};
};
config = lib.mkIf cfg.ldap.enable {
services.hedgedoc.settings.ldap = {
url = "ldaps://${ldap.domainName}:${toString ldap.port}";
bindDn = ldap.bindDN;
bindCredentials = "$bindCredentials";
searchBase = ldap.userBaseDN;
searchFilter = ldap.userFilter "{{username}}";
tlsca = "/etc/ssl/certs/ca-certificates.crt";
useridField = ldap.userField;
};
};
}