aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-12-28 16:56:48 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-12-28 16:56:48 +0100
commitdedf591df65bcd1222a9e053fd6fc7631f74ab7e (patch)
tree46ea06f3846c1600f73c3bb4345682f95a90fb92
parenta1bb33c420e5a2daeca616693e28a086bc5b3fac (diff)
downloadNix-dedf591df65bcd1222a9e053fd6fc7631f74ab7e.tar.gz
Nix-dedf591df65bcd1222a9e053fd6fc7631f74ab7e.tar.zst
Nix-dedf591df65bcd1222a9e053fd6fc7631f74ab7e.zip
Add mysql
-rw-r--r--virtual/eldiron.nix36
1 files changed, 35 insertions, 1 deletions
diff --git a/virtual/eldiron.nix b/virtual/eldiron.nix
index 04b11b8..cfbb464 100644
--- a/virtual/eldiron.nix
+++ b/virtual/eldiron.nix
@@ -8,7 +8,7 @@
8 networking = { 8 networking = {
9 firewall = { 9 firewall = {
10 enable = true; 10 enable = true;
11 allowedTCPPorts = [ 22 80 443 5432 ]; 11 allowedTCPPorts = [ 22 80 443 3306 5432 ];
12 }; 12 };
13 }; 13 };
14 14
@@ -62,7 +62,41 @@
62 }; 62 };
63 }; 63 };
64 64
65 # FIXME: environment variables ?
66 security.pam.services = let
67 pam_ldap = pkgs.pam_ldap;
68 pam_ldap_mysql = pkgs.writeText "mysql.conf" ''
69 host ldap.immae.eu
70 base dc=immae,dc=eu
71 binddn cn=mysql,cn=pam,ou=services,dc=immae,dc=eu
72 bindpw ${builtins.getEnv "NIXOPS_MYSQL_PAM_PASSWORD"}
73 pam_filter memberOf=cn=users,cn=mysql,cn=pam,ou=services,dc=immae,dc=eu
74 '';
75 in [
76 {
77 name = "mysql";
78 text = ''
79 # https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/
80 auth required ${pam_ldap}/lib/security/pam_ldap.so config=${pam_ldap_mysql}
81 account required ${pam_ldap}/lib/security/pam_ldap.so config=${pam_ldap_mysql}
82 '';
83 }
84 ];
85
86 # FIXME: initial sync
87 # FIXME: backup
88 # FIXME: restart after pam
89 # FIXME: pam access doesn’t work (because of php module)
90 services.mysql = rec {
91 enable = true;
92 package = pkgs.mariadb.overrideAttrs(old: rec {
93 cmakeFlags = old.cmakeFlags ++ [ "-DWITH_AUTHENTICATION_PAM=ON" ];
94 buildInputs = old.buildInputs ++ [ pkgs.pam ];
95 });
96 };
97
65 # FIXME: initial sync 98 # FIXME: initial sync
99 # FIXME: backup
66 services.postgresql = rec { 100 services.postgresql = rec {
67 enable = true; 101 enable = true;
68 package = pkgs.postgresql100.overrideAttrs(old: rec { 102 package = pkgs.postgresql100.overrideAttrs(old: rec {