X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fdatabases%2Fopenldap%2Fdefault.nix;h=e048d565200f532eaddfa6c4ab8eb7ce3112254e;hb=4aac110f17f0528d90510eec00c9a8df60bcf04f;hp=46f85d26f0ca6f1da3358690ee5eee78334e97cb;hpb=9ade8f6eb774dc7d19d82a070199b5024786b819;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/databases/openldap/default.nix b/modules/private/databases/openldap/default.nix index 46f85d2..e048d56 100644 --- a/modules/private/databases/openldap/default.nix +++ b/modules/private/databases/openldap/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, myconfig, ... }: +{ lib, pkgs, config, ... }: let cfg = config.myServices.databases.openldap; ldapConfig = let @@ -27,8 +27,8 @@ let moduleload memberof database hdb - suffix "${myconfig.env.ldap.base}" - rootdn "${myconfig.env.ldap.root_dn}" + suffix "${cfg.baseDn}" + rootdn "${cfg.rootDn}" include ${config.secrets.location}/ldap/password directory ${cfg.dataDir} overlay memberof @@ -53,6 +53,30 @@ in description = "Whether to enable ldap"; type = lib.types.bool; }; + baseDn = lib.mkOption { + type = lib.types.str; + description = '' + Base DN for LDAP + ''; + }; + rootDn = lib.mkOption { + type = lib.types.str; + description = '' + Root DN + ''; + }; + rootPw = lib.mkOption { + type = lib.types.str; + description = '' + Root (Hashed) password + ''; + }; + accessFile = lib.mkOption { + type = lib.types.path; + description = '' + The file path that defines the access + ''; + }; dataDir = lib.mkOption { type = lib.types.path; default = "/var/lib/openldap"; @@ -89,14 +113,14 @@ in permissions = "0400"; user = "openldap"; group = "openldap"; - text = "rootpw ${myconfig.env.ldap.root_pw}"; + text = "rootpw ${cfg.rootPw}"; } { - dest = "ldap/access "; + dest = "ldap/access"; permissions = "0400"; user = "openldap"; group = "openldap"; - text = builtins.readFile "${myconfig.privateFiles}/ldap.conf"; + text = builtins.readFile "${cfg.accessFile}"; } ]; users.users.openldap.extraGroups = [ "keys" ];