fmt
This commit is contained in:
parent
4aa0ac2a7f
commit
ac2780eb5b
1 changed files with 36 additions and 29 deletions
|
|
@ -133,7 +133,11 @@ in {
|
||||||
dump = site.backup.database;
|
dump = site.backup.database;
|
||||||
paths = builtins.concatLists [
|
paths = builtins.concatLists [
|
||||||
site.backup.paths
|
site.backup.paths
|
||||||
(if dump != null then [ "/var/backup/${key}.sql" ] else [])
|
(
|
||||||
|
if dump != null
|
||||||
|
then ["/var/backup/${key}.sql"]
|
||||||
|
else []
|
||||||
|
)
|
||||||
];
|
];
|
||||||
preHook = lib.mkIf (dump != null) ''
|
preHook = lib.mkIf (dump != null) ''
|
||||||
mkdir -p /var/backup
|
mkdir -p /var/backup
|
||||||
|
|
@ -144,35 +148,38 @@ in {
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
if site.backup.enable
|
if site.backup.enable
|
||||||
then acc // {
|
then
|
||||||
"${key}" = {
|
acc
|
||||||
repo = backup_cfg.borgRepository + "/./${key}";
|
// {
|
||||||
environment = {
|
"${key}" = {
|
||||||
BORG_RSH = "ssh -i ${backup_cfg.borgSSHKey} -o 'StrictHostKeyChecking=no'";
|
repo = backup_cfg.borgRepository + "/./${key}";
|
||||||
|
environment = {
|
||||||
|
BORG_RSH = "ssh -i ${backup_cfg.borgSSHKey} -o 'StrictHostKeyChecking=no'";
|
||||||
|
};
|
||||||
|
inherit paths;
|
||||||
|
encryption = {
|
||||||
|
mode = "keyfile";
|
||||||
|
passCommand = backup_cfg.borgPassCommand;
|
||||||
|
};
|
||||||
|
compression = "auto,lzma";
|
||||||
|
startAt = "daily";
|
||||||
|
prune.keep = {
|
||||||
|
daily = 7;
|
||||||
|
weekly = 4;
|
||||||
|
monthly = -1;
|
||||||
|
};
|
||||||
|
inherit preHook;
|
||||||
|
inherit postHook;
|
||||||
};
|
};
|
||||||
inherit paths;
|
}
|
||||||
encryption = {
|
else acc) {} (builtins.attrNames cfg);
|
||||||
mode = "keyfile";
|
|
||||||
passCommand = backup_cfg.borgPassCommand;
|
|
||||||
};
|
|
||||||
compression = "auto,lzma";
|
|
||||||
startAt = "daily";
|
|
||||||
prune.keep = {
|
|
||||||
daily = 7;
|
|
||||||
weekly = 4;
|
|
||||||
monthly = -1;
|
|
||||||
};
|
|
||||||
inherit preHook;
|
|
||||||
inherit postHook;
|
|
||||||
};
|
|
||||||
} else acc) {} (builtins.attrNames cfg);
|
|
||||||
|
|
||||||
systemd.tmpfiles.settings = {
|
systemd.tmpfiles.settings = {
|
||||||
"99-borgdatabasebackups"."/var/backup/postgres".d = {
|
"99-borgdatabasebackups"."/var/backup/postgres".d = {
|
||||||
user = "root";
|
user = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
mode = "0755";
|
mode = "0755";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue