summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/backup.nix
blob: 936f31c1c01d06f653844506e8c10bb5b4662680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ config, lib, ... }:
with lib;
let
  startAt = "0,6,12,18:00";
  defaultBackupServer = config.krebs.hosts.omo;
  defaultBackupDir = "/home/backup";
  defaultPull = host: src: {
    method = "pull";
    src = {
      inherit host;
      path = src;
    };
    dst = {
      host = defaultBackupServer;
      path = defaultBackupDir + src;
    };
    startAt = "0,6,12,18:00";
    snapshots = {
      hourly   = { format = "%Y-%m-%dT%H";    retain =  4; };
      daily    = { format = "%Y-%m-%d";       retain =  7; };
      weekly   = { format = "%YW%W";          retain =  4; };
      monthly  = { format = "%Y-%m";          retain = 12; };
      yearly   = { format = "%Y";                          };
    };
  };
in {
  krebs.backup.plans = {
    wry-to-omo_var-www = defaultPull wry "/var/www";
  };
}