diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-12-12 00:24:23 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-12-20 04:12:27 +0100 |
commit | ab8f306d7c2c49b8116e1af7b355ed2384617ed9 (patch) | |
tree | d1061ec0436fd096de2332a892eb984c63cb125e /modules/private/databases | |
parent | 4227853a03923e04daf3dd511a4b5a1ab5d527e7 (diff) | |
download | Nix-ab8f306d7c2c49b8116e1af7b355ed2384617ed9.tar.gz Nix-ab8f306d7c2c49b8116e1af7b355ed2384617ed9.tar.zst Nix-ab8f306d7c2c49b8116e1af7b355ed2384617ed9.zip |
Add specification for the private config file as a module.
Diffstat (limited to 'modules/private/databases')
-rw-r--r-- | modules/private/databases/default.nix | 40 | ||||
-rw-r--r-- | modules/private/databases/openldap_replication.nix | 2 | ||||
-rw-r--r-- | modules/private/databases/redis.nix | 8 | ||||
-rw-r--r-- | modules/private/databases/redis_replication.nix | 6 |
4 files changed, 28 insertions, 28 deletions
diff --git a/modules/private/databases/default.nix b/modules/private/databases/default.nix index 7371410..8c5eb9a 100644 --- a/modules/private/databases/default.nix +++ b/modules/private/databases/default.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { lib, config, myconfig, nodes, ... }: | 1 | { lib, config, nodes, ... }: |
2 | let | 2 | let |
3 | cfg = config.myServices.databases; | 3 | cfg = config.myServices.databases; |
4 | in | 4 | in |
@@ -18,49 +18,49 @@ in | |||
18 | mariadb = { | 18 | mariadb = { |
19 | enable = true; | 19 | enable = true; |
20 | ldapConfig = { | 20 | ldapConfig = { |
21 | inherit (myconfig.env.ldap) host base; | 21 | inherit (config.myEnv.ldap) host base; |
22 | inherit (myconfig.env.databases.mysql.pam) dn filter password; | 22 | inherit (config.myEnv.databases.mysql.pam) dn filter password; |
23 | }; | 23 | }; |
24 | replicationLdapConfig = { | 24 | replicationLdapConfig = { |
25 | inherit (myconfig.env.ldap) host base; | 25 | inherit (config.myEnv.ldap) host base; |
26 | inherit (myconfig.env.ldap.eldiron) dn password; | 26 | inherit (config.myEnv.servers.eldiron.ldap) dn password; |
27 | }; | 27 | }; |
28 | credentials.root = myconfig.env.databases.mysql.systemUsers.root; | 28 | credentials.root = config.myEnv.databases.mysql.systemUsers.root; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | openldap = { | 31 | openldap = { |
32 | accessFile = "${myconfig.privateFiles}/ldap.conf"; | 32 | accessFile = "${config.myEnv.privateFiles}/ldap.conf"; |
33 | baseDn = myconfig.env.ldap.base; | 33 | baseDn = config.myEnv.ldap.base; |
34 | rootDn = myconfig.env.ldap.root_dn; | 34 | rootDn = config.myEnv.ldap.root_dn; |
35 | rootPw = myconfig.env.ldap.root_pw; | 35 | rootPw = config.myEnv.ldap.root_pw; |
36 | enable = true; | 36 | enable = true; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | postgresql = { | 39 | postgresql = { |
40 | ldapConfig = { | 40 | ldapConfig = { |
41 | inherit (myconfig.env.ldap) host base; | 41 | inherit (config.myEnv.ldap) host base; |
42 | inherit (myconfig.env.databases.postgresql.pam) dn filter password; | 42 | inherit (config.myEnv.databases.postgresql.pam) dn filter password; |
43 | }; | 43 | }; |
44 | replicationLdapConfig = { | 44 | replicationLdapConfig = { |
45 | inherit (myconfig.env.ldap) host base; | 45 | inherit (config.myEnv.ldap) host base; |
46 | inherit (myconfig.env.ldap.eldiron) dn password; | 46 | inherit (config.myEnv.servers.eldiron.ldap) dn password; |
47 | }; | 47 | }; |
48 | authorizedHosts = { | 48 | authorizedHosts = { |
49 | immaeEu = [{ | 49 | immaeEu = [{ |
50 | ip4 = [ | 50 | ip4 = [ |
51 | myconfig.env.servers.immaeEu.ips.main.ip4 | 51 | config.myEnv.servers.immaeEu.ips.main.ip4 |
52 | myconfig.env.servers.immaeEu.ips.alt.ip4 | 52 | config.myEnv.servers.immaeEu.ips.alt.ip4 |
53 | ]; | 53 | ]; |
54 | }]; | 54 | }]; |
55 | }; | 55 | }; |
56 | replicationHosts = { | 56 | replicationHosts = { |
57 | backup-1 = { | 57 | backup-1 = { |
58 | ip4 = [myconfig.env.servers.backup-1.ips.main.ip4]; | 58 | ip4 = [config.myEnv.servers.backup-1.ips.main.ip4]; |
59 | ip6 = myconfig.env.servers.backup-1.ips.main.ip6; | 59 | ip6 = config.myEnv.servers.backup-1.ips.main.ip6; |
60 | }; | 60 | }; |
61 | backup-2 = { | 61 | backup-2 = { |
62 | ip4 = [myconfig.env.servers.backup-2.ips.main.ip4]; | 62 | ip4 = [config.myEnv.servers.backup-2.ips.main.ip4]; |
63 | ip6 = myconfig.env.servers.backup-2.ips.main.ip6; | 63 | ip6 = config.myEnv.servers.backup-2.ips.main.ip6; |
64 | }; | 64 | }; |
65 | }; | 65 | }; |
66 | enable = true; | 66 | enable = true; |
diff --git a/modules/private/databases/openldap_replication.nix b/modules/private/databases/openldap_replication.nix index c0c16e6..7833e31 100644 --- a/modules/private/databases/openldap_replication.nix +++ b/modules/private/databases/openldap_replication.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { pkgs, config, myconfig, lib, ... }: | 1 | { pkgs, config, lib, ... }: |
2 | let | 2 | let |
3 | cfg = config.myServices.databasesReplication.openldap; | 3 | cfg = config.myServices.databasesReplication.openldap; |
4 | eldiron_schemas = pkgs.callPackage ./openldap/eldiron_schemas.nix {}; | 4 | eldiron_schemas = pkgs.callPackage ./openldap/eldiron_schemas.nix {}; |
diff --git a/modules/private/databases/redis.nix b/modules/private/databases/redis.nix index 693f402..4b26283 100644 --- a/modules/private/databases/redis.nix +++ b/modules/private/databases/redis.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { lib, config, pkgs, myconfig, ... }: | 1 | { lib, config, pkgs, ... }: |
2 | let | 2 | let |
3 | cfg = config.myServices.databases.redis; | 3 | cfg = config.myServices.databases.redis; |
4 | in { | 4 | in { |
@@ -96,7 +96,7 @@ in { | |||
96 | WorkerThreads 1 | 96 | WorkerThreads 1 |
97 | 97 | ||
98 | Authority { | 98 | Authority { |
99 | Auth "${myconfig.env.databases.redis.predixy.read}" { | 99 | Auth "${config.myEnv.databases.redis.predixy.read}" { |
100 | Mode read | 100 | Mode read |
101 | } | 101 | } |
102 | } | 102 | } |
@@ -105,7 +105,7 @@ in { | |||
105 | Databases 16 | 105 | Databases 16 |
106 | RefreshMethod fixed | 106 | RefreshMethod fixed |
107 | Group shard001 { | 107 | Group shard001 { |
108 | + ${myconfig.env.databases.redis.socket} | 108 | + ${config.myEnv.databases.redis.socket} |
109 | } | 109 | } |
110 | } | 110 | } |
111 | ''; | 111 | ''; |
@@ -115,7 +115,7 @@ in { | |||
115 | user = "spiped"; | 115 | user = "spiped"; |
116 | group = "spiped"; | 116 | group = "spiped"; |
117 | permissions = "0400"; | 117 | permissions = "0400"; |
118 | text = myconfig.env.databases.redis.spiped_key; | 118 | text = config.myEnv.databases.redis.spiped_key; |
119 | } | 119 | } |
120 | ]; | 120 | ]; |
121 | 121 | ||
diff --git a/modules/private/databases/redis_replication.nix b/modules/private/databases/redis_replication.nix index cc626f5..6ec52c9 100644 --- a/modules/private/databases/redis_replication.nix +++ b/modules/private/databases/redis_replication.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { pkgs, config, myconfig, lib, ... }: | 1 | { pkgs, config, lib, ... }: |
2 | let | 2 | let |
3 | cfg = config.myServices.databasesReplication.redis; | 3 | cfg = config.myServices.databasesReplication.redis; |
4 | in | 4 | in |
@@ -63,7 +63,7 @@ in | |||
63 | config.redis = { | 63 | config.redis = { |
64 | encrypt = true; | 64 | encrypt = true; |
65 | source = "127.0.0.1:16379"; | 65 | source = "127.0.0.1:16379"; |
66 | target = "${myconfig.env.servers.eldiron.ips.main.ip4}:16379"; | 66 | target = "${config.myEnv.servers.eldiron.ips.main.ip4}:16379"; |
67 | keyfile = "${config.secrets.location}/redis/spiped_eldiron_keyfile"; | 67 | keyfile = "${config.secrets.location}/redis/spiped_eldiron_keyfile"; |
68 | }; | 68 | }; |
69 | }; | 69 | }; |
@@ -103,7 +103,7 @@ in | |||
103 | user = "spiped"; | 103 | user = "spiped"; |
104 | group = "spiped"; | 104 | group = "spiped"; |
105 | permissions = "0400"; | 105 | permissions = "0400"; |
106 | text = myconfig.env.databases.redis.spiped_key; | 106 | text = config.myEnv.databases.redis.spiped_key; |
107 | } | 107 | } |
108 | ]; | 108 | ]; |
109 | 109 | ||