2021-03-30 12:07:20 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
# Pull changes from git repos
|
|
|
|
systemd.user.services.git-pull = {
|
|
|
|
description = "Pull git repositories";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
path = with pkgs; [ git ];
|
|
|
|
script = ''
|
|
|
|
base_folder=/vault/code
|
|
|
|
cd "$base_folder" || exit
|
|
|
|
ls | xargs -P10 -I{} git -C {} pull --rebase
|
|
|
|
'';
|
|
|
|
serviceConfig = { Type = "oneshot"; };
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.timers.doom-upgrade = {
|
|
|
|
description = "Daily code update";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "22:00:00";
|
|
|
|
Unit = "git-pull.service";
|
|
|
|
};
|
|
|
|
};
|
2021-04-07 13:18:49 +02:00
|
|
|
|
|
|
|
# PostgreSQL daily backups
|
|
|
|
services.postgresqlBackup = {
|
|
|
|
enable = true;
|
|
|
|
backupAll = true;
|
|
|
|
location = "/vault/backups/databases/nextcloud";
|
|
|
|
startAt = "*-*-* 05:15:00";
|
|
|
|
};
|
2021-03-30 12:07:20 +02:00
|
|
|
}
|