summaryrefslogtreecommitdiffstats
path: root/lass/2configs/websites/sqlBackup.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-06-01 00:13:19 +0200
committerlassulus <lass@aidsballs.de>2016-06-01 00:13:19 +0200
commit76296d5cc5f1ddb1108c3f213204bb386353ad93 (patch)
treeb92592ab66862018db029b049fd41b7334740201 /lass/2configs/websites/sqlBackup.nix
parent18e602dc707cdd63e02459eb10845bb725763ddc (diff)
l 2 websites: put sqlBackup in seperate file
Diffstat (limited to 'lass/2configs/websites/sqlBackup.nix')
-rw-r--r--lass/2configs/websites/sqlBackup.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/lass/2configs/websites/sqlBackup.nix b/lass/2configs/websites/sqlBackup.nix
new file mode 100644
index 000000000..7cb4b320e
--- /dev/null
+++ b/lass/2configs/websites/sqlBackup.nix
@@ -0,0 +1,28 @@
+{ config, lib, pkgs, ... }:
+
+{
+ krebs.secret.files.mysql_rootPassword = {
+ path = "${config.services.mysql.dataDir}/mysql_rootPassword";
+ owner.name = "root";
+ source-path = toString <secrets> + "/mysql_rootPassword";
+ };
+
+ services.mysql = {
+ enable = true;
+ package = pkgs.mariadb;
+ rootPassword = config.krebs.secret.files.mysql_rootPassword.path;
+ };
+
+ systemd.services.mysql = {
+ requires = [ "secret.service" ];
+ after = [ "secret.service" ];
+ };
+
+ lass.mysqlBackup = {
+ enable = true;
+ config.all = {
+ password = toString (<secrets/mysql_rootPassword>);
+ };
+ };
+}
+