]> Git — Sourcephile - sourcephile-nix.git/blob - machines/mermet/sanoid.nix
nginx: sourcephile.fr: www: fix redirection
[sourcephile-nix.git] / machines / mermet / sanoid.nix
1 { pkgs, lib, config, ... }:
2 let
3 inherit (config.users) users;
4 in
5 {
6 system.activationScripts.backup = ''
7 ${pkgs.zfs}/bin/zfs allow -u ${users.backup.name} bookmark,hold,send rpool
8 '';
9 services.sanoid = {
10 enable = true;
11 templates = {
12 local = {
13 autosnap = true;
14 autoprune = true;
15 monthly = 3;
16 };
17 remote = {
18 autosnap = false;
19 autoprune = true;
20 monthly = 3;
21 };
22 };
23 extraArgs = [
24 "--verbose"
25 #"--debug"
26 ];
27 datasets = {
28 "rpool/var/git" = {
29 use_template = [ "local" ];
30 daily = 7;
31 };
32 "rpool/var/mail" = {
33 use_template = [ "local" ];
34 hourly = 12;
35 daily = 7;
36 };
37 "rpool/var/public-inbox" = {
38 use_template = [ "local" ];
39 daily = 7;
40 };
41 "rpool/var/www" = {
42 use_template = [ "local" ];
43 daily = 7;
44 };
45 "rpool/var/redis" = {
46 use_template = [ "local" ];
47 hourly = 0;
48 daily = 7;
49 };
50 "rpool/home/julm/mail" = {
51 use_template = [ "local" ];
52 hourly = 12;
53 daily = 7;
54 };
55 "rpool/home/julm/log" = {
56 use_template = [ "local" ];
57 hourly = 12;
58 daily = 7;
59 monthly = 1;
60 };
61 "rpool/backup/losurdo/home/julm/work" = {
62 use_template = [ "remote" ];
63 daily = 31;
64 };
65 "rpool/backup/losurdo/var/postgresql" = {
66 use_template = [ "remote" ];
67 daily = 31;
68 };
69 };
70 };
71 }