aboutsummaryrefslogtreecommitdiff
path: root/modules/private/databases/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-17 10:26:33 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-17 10:26:49 +0200
commit4aac110f17f0528d90510eec00c9a8df60bcf04f (patch)
treef3fd7dfd999f56f397c1cdc972dd37978e15f0cd /modules/private/databases/default.nix
parentffb14c1c25280777f5db3d2129c48dd319381f65 (diff)
downloadNix-4aac110f17f0528d90510eec00c9a8df60bcf04f.tar.gz
Nix-4aac110f17f0528d90510eec00c9a8df60bcf04f.tar.zst
Nix-4aac110f17f0528d90510eec00c9a8df60bcf04f.zip
Remove direct dependency to myconfig in database modules
Diffstat (limited to 'modules/private/databases/default.nix')
-rw-r--r--modules/private/databases/default.nix53
1 files changed, 49 insertions, 4 deletions
diff --git a/modules/private/databases/default.nix b/modules/private/databases/default.nix
index 78d91dc..3f7a44b 100644
--- a/modules/private/databases/default.nix
+++ b/modules/private/databases/default.nix
@@ -1,4 +1,4 @@
1{ lib, config, ... }: 1{ lib, config, myconfig, ... }:
2let 2let
3 cfg = config.myServices.databases; 3 cfg = config.myServices.databases;
4in 4in
@@ -9,10 +9,55 @@ in
9 description = "Default databases configurations for certificates as accepted by acme"; 9 description = "Default databases configurations for certificates as accepted by acme";
10 }; 10 };
11 }; 11 };
12
13 config.nixpkgs.overlays = lib.mkIf cfg.enable [ (self: super: {
14 postgresql = self.postgresql_11_custom;
15 }) ];
16
12 config.myServices.databases = lib.mkIf cfg.enable { 17 config.myServices.databases = lib.mkIf cfg.enable {
13 mariadb.enable = true; 18 mariadb = {
14 openldap.enable = true; 19 enable = true;
15 postgresql.enable = true; 20 ldapConfig = {
21 inherit (myconfig.env.ldap) host base;
22 inherit (myconfig.env.databases.mysql.pam) dn filter password;
23 };
24 credentials.root = myconfig.env.databases.mysql.systemUsers.root;
25 };
26
27 openldap = {
28 accessFile = "${myconfig.privateFiles}/ldap.conf";
29 baseDn = myconfig.env.ldap.base;
30 rootDn = myconfig.env.ldap.root_dn;
31 rootPw = myconfig.env.ldap.root_pw;
32 enable = true;
33 };
34
35 postgresql = {
36 ldapConfig = {
37 inherit (myconfig.env.ldap) host base;
38 inherit (myconfig.env.databases.postgresql.pam) dn filter password;
39 };
40 replicationLdapConfig = {
41 inherit (myconfig.env.ldap) host base password;
42 dn = myconfig.env.ldap.host_dn;
43 };
44 authorizedHosts = {
45 immaeEu = [{
46 ip4 = [
47 myconfig.env.servers.immaeEu.ips.main.ip4
48 myconfig.env.servers.immaeEu.ips.alt.ip4
49 ];
50 }];
51 };
52 replicationHosts = {
53 backup-1 = {
54 ip4 = [myconfig.env.servers.backup-1.ips.main.ip4];
55 ip6 = myconfig.env.servers.backup-1.ips.main.ip6;
56 };
57 };
58 enable = true;
59 };
60
16 redis.enable = true; 61 redis.enable = true;
17 }; 62 };
18} 63}