X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fdatabases%2Fdefault.nix;h=1241658a18574846a057ca06b68d444a42db25f3;hb=282c67a117b7d349b30a96972b050d630f906dec;hp=3f7a44bf2d776f45d9dbfbec68f7713a476228c9;hpb=4aac110f17f0528d90510eec00c9a8df60bcf04f;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/databases/default.nix b/modules/private/databases/default.nix index 3f7a44b..1241658 100644 --- a/modules/private/databases/default.nix +++ b/modules/private/databases/default.nix @@ -1,4 +1,4 @@ -{ lib, config, myconfig, ... }: +{ lib, config, nodes, ... }: let cfg = config.myServices.databases; in @@ -10,49 +10,43 @@ in }; }; - config.nixpkgs.overlays = lib.mkIf cfg.enable [ (self: super: { - postgresql = self.postgresql_11_custom; - }) ]; - config.myServices.databases = lib.mkIf cfg.enable { mariadb = { enable = true; ldapConfig = { - inherit (myconfig.env.ldap) host base; - inherit (myconfig.env.databases.mysql.pam) dn filter password; + inherit (config.myEnv.ldap) host base; + inherit (config.myEnv.databases.mysql.pam) dn filter password; + }; + replicationLdapConfig = { + inherit (config.myEnv.ldap) host base; + inherit (config.myEnv.servers.eldiron.ldap) dn password; }; - credentials.root = myconfig.env.databases.mysql.systemUsers.root; + credentials.root = config.myEnv.databases.mysql.systemUsers.root; }; openldap = { - accessFile = "${myconfig.privateFiles}/ldap.conf"; - baseDn = myconfig.env.ldap.base; - rootDn = myconfig.env.ldap.root_dn; - rootPw = myconfig.env.ldap.root_pw; + accessFile = ../../../nixops/secrets/ldap.conf; + baseDn = config.myEnv.ldap.base; + rootDn = config.myEnv.ldap.root_dn; + rootPw = config.myEnv.ldap.root_pw; enable = true; }; postgresql = { ldapConfig = { - inherit (myconfig.env.ldap) host base; - inherit (myconfig.env.databases.postgresql.pam) dn filter password; + inherit (config.myEnv.ldap) host base; + inherit (config.myEnv.databases.postgresql.pam) dn filter password; }; replicationLdapConfig = { - inherit (myconfig.env.ldap) host base password; - dn = myconfig.env.ldap.host_dn; + inherit (config.myEnv.ldap) host base; + inherit (config.myEnv.servers.eldiron.ldap) dn password; }; authorizedHosts = { - immaeEu = [{ - ip4 = [ - myconfig.env.servers.immaeEu.ips.main.ip4 - myconfig.env.servers.immaeEu.ips.alt.ip4 - ]; - }]; }; replicationHosts = { - backup-1 = { - ip4 = [myconfig.env.servers.backup-1.ips.main.ip4]; - ip6 = myconfig.env.servers.backup-1.ips.main.ip6; + backup-2 = { + ip4 = [config.myEnv.servers.backup-2.ips.main.ip4]; + ip6 = config.myEnv.servers.backup-2.ips.main.ip6; }; }; enable = true;