diff options
Diffstat (limited to 'nixops/modules/databases')
-rw-r--r-- | nixops/modules/databases/mysql.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nixops/modules/databases/mysql.nix b/nixops/modules/databases/mysql.nix index acf4750..a625d48 100644 --- a/nixops/modules/databases/mysql.nix +++ b/nixops/modules/databases/mysql.nix | |||
@@ -51,6 +51,21 @@ in { | |||
51 | ''; | 51 | ''; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | services.cron = { | ||
55 | enable = true; | ||
56 | systemCronJobs = let | ||
57 | mycnf = pkgs.writeText "my.cnf" '' | ||
58 | [mysqldump] | ||
59 | user = root | ||
60 | password = ${myconfig.env.databases.mysql.systemUsers.root} | ||
61 | ''; | ||
62 | in [ | ||
63 | '' | ||
64 | 30 1,13 * * * root ${pkgs.mariadb}/bin/mysqldump --defaults-file=${mycnf} --all-databases > /var/lib/mysql/backup.sql | ||
65 | '' | ||
66 | ]; | ||
67 | }; | ||
68 | |||
54 | security.pam.services = let | 69 | security.pam.services = let |
55 | pam_ldap = "${pkgs.pam_ldap}/lib/security/pam_ldap.so"; | 70 | pam_ldap = "${pkgs.pam_ldap}/lib/security/pam_ldap.so"; |
56 | pam_ldap_mysql = with myconfig.env.databases.mysql.pam; | 71 | pam_ldap_mysql = with myconfig.env.databases.mysql.pam; |